.


:




:

































 

 

 

 


.




. :

16. ;

17. ;

18. ;

19. .

. . , . . :

{

n++; //

summa+=n;

}

 

{

int n=0;

n++; //

summa+=n;

}

 

. - .

.

 

if (<->) <>; //

if (<->) <1>; //

else <2>;

 

<-> , . <-> (. . ), . :

if (x<y&&x<z)min=x;

<-> , 1, <-> 2. :

if (d>=0)

{

x1=(-b-sqrt(d))/(2*a);

x2=(-b+sqrt(d))/(2*a);

cout<< \nx1=<<x1<<x2=<<x2;

}

else cout<<\n ;

 

.

 

switch (<>)

{

case <1>: <1 >;

case <2>: <2 >;

...........

default: <>;

 

switch, , switch , case. . , , . , switch , , default. default .

:

switch (number)

{

case 1: cout<< =1;break;

case 2: cout<< 2 * 2<<number * number;

case 3: cout<< 3 * 3<<number * number; break;

case 4: cout<< number<<- ; break;

default: cout<< ;

}

 

. . , , , , . . ( ), ( ). , , , . , , .

, , . , , .

, , , .

, . , . break, continue, return goto. .

, , /C++ while, do while for.

while (<->)

<_>;

<-> . , . . 0, <-> .

do

<_>;

while (<->);

, <-> .

 

for (<_1>;<->;<_3>)

_;

<_1> <_3> , . <_1> - ().<-> , 0, , <_3>. <_3> - (). , <-> ( 0). , ; .

 

.

:

for (n=10; n>0; n--)

{ < >};

:

for (n=2; n>60; n+=13)

{ < >};

, :

for (num=1;num*num*num<216; num++)

{ < >};

:

for (d=100.0; d<150.0;d*=1.1)

{ < >};

for (x=1;y<=75;y=5*(x++)+10)

{ < >};

:

for (x=1, y=0; x<10;x++;y+=x);

 





:


: 2016-11-02; !; : 548 |


:

:

- , , .
==> ...

1538 - | 1348 -


© 2015-2024 lektsii.org - -

: 0.015 .