I
main () :
printf("Hello world!\n");
Getch();
. "Hello world!" , " ", , , . , . 1.4.
, , . . , . -. <F9>, Run/Run. , , . 1.5.
, : : " ". , main(), . . , , . .
Help/C++Builder Help . . 1 ( ) printf. 2 1 . <Enter>. Help, printf, , (Header file stdio.h), (#include <stdio.h>). #include . , . Help , getch() #indude <conio.h>. , . 1.6.
. 1.6.
<F9> , . 1.7.
. 1.7. .
. Hello world!. , , . , File/Save All.
. , - , , , . , , , , . , , . - main (). main() . , , . , : , , - . , main(): printf() getch().
|
|
printf() (, ). , : \n. 32- ASCII. . \n printf(), , . printf(), , \n. \n , ( ).
getch() : - . , . getch(), printf() main(), , . , Hello world!, , . , , , getch() . main(). . , getch() - - , . , , , .
I
II
.
: , - .
1. C++Builder , - , . C++ Builder 6 File | New Application.
2. , , Button Standard . . , C++Builder Button1.
|
|
3. Standard Label. . C++Builder Label1.
4. , . , .
5. Button 1 . Caption (), Buttonl (, C++Builder) .
6. Label1, . , Font (), Style () true fsBold ().
7. Caption Label1, , .
, Caption Label1 . . OnClick. , .
8. Button1 , , (Events), OnClick ( ) . . OnClick ( ) : Buttonl . :
void__fastcall TForml::Button1Click(TObject *Sender)
(TForml), (Button1) On (Click).
9. Label 1. :
Labell->Caption = " !";
, :
void __fastcall TForml::ButtonlClick(TObject *Sender)
{
Label1->Caption = " !";
}
, , . = , , , , . : Label1->Caption. , Caption Label1. : , ->: - >, . . Caption !.
Label1, , , . , , , . , Enter, (, ) . : , . , , , Enter, .
, . , Sort by Name .
|
|
, - , - ( , ). , C++Builder, , , , , . , , . , , .
, . . Run Run, F9. , , , . . : , , . , .
IIIc
.
cin <<, , , cout.
1. #include <iostream.h>, iostream.h, cout.
2. , int. , , .. , 7, -11, 0, 31914.
3.
. , . : cout " \".
1.
,
cin , . cin , . : cin .
cout cin . , .
5-6. 3-4.
7.
integer1 integer2 sum, =. : sum , , integerl + integer2. .
8.
, sum, endl ( end line ) . endl . , , , , , endl .
|
|
, . , . () . , .
.
cout << "Suma ravna" << integerl + integer2 << endl;
:
IIIa