.


:




:

































 

 

 

 


.

.

 

# include <iostream> .

/ iostream. , .

Main () C++.

main , main , .

C++ , main.

{ .

} .

(;).

<< .

(<<) .

\n ( )

\t ( )

\r

\a

\\ - ( )

\* - ( ).

(\) . , . , \ .

\n .

return 0; // , - main.

C++ return .

getch () .

cout<<

cin>>

cout <<AAA\n \n C++!\n;

AAA

C++

 

, .

 

{

int integer1, integer2, sum; //

 

cout < = \n;

cin >> integer1 //

sum = integer1+integer2; //

cout << << sum <<endl; //

 

. , , (_), . .

C++ .

. .

 

endl end line .

endl .

endl .

 

:

()

* -

/ -

% -

 

+

 

 

= = x = = y x y

! = x! = y x y

 

 

> x > y x y

< x < y x y

> = x > = y x y

< = x < = y x y


for while.

 

// | 1|

//

#include "stdafx.h"//

#include <iostream>

#include <iomanip>// ,

using namespace std;

int _tmain(int argc, _TCHAR* argv[])

{

setlocale(LC_ALL,"");

int sum=5;

cout <<"| 1|"<<endl;

for (int i = 2; i < 7; i+=2)

sum+=i; // sum=sum+i;

cout << sum<< endl;

 

cout << endl;

return 0;

}

 

// | 2|

//

#include "stdafx.h"

#include <iostream>

#include <iomanip>

using namespace std;

int _tmain(int argc, _TCHAR* argv[])

 

{

setlocale(LC_ALL,"");

int a,total,c,d;

 

total=0; //

c=1; //

 

while (c<=3) //

 

{

cout <<" "<<endl;

cin>>a;

total+=a;

c=c+1;

}

//

 

d=total/3; //

cout <<" = "<<d<<endl;

cout << endl;

return 0;

}

 


: =+3; +=3.

 

= 3, d = 5, e = 4, f = 6, g = 12.

 

+= + =7  
-= d - = 4  
*= e * =5  
/= f / =3  
%= g % = 9  

 

.

 

++ ++ , .
++ a++ , 1.
-- --b b b , .
-- b-- b, b 1.

 

 

:

 

AND

 

if ((x==5) && (y==5))

 

OR

 

if ((x==5) || (y==5))

 

 

NOT

 

if (!(x==5)) if (x!=5)

 



<== | ==>
. |
:


: 2017-04-15; !; : 317 |


:

:

, .
==> ...

1475 - | 1386 -


© 2015-2024 lektsii.org - -

: 0.013 .