.


:




:

































 

 

 

 





: - ( ), .

().

, ; ( ). .

: ( ), ( ), ; . , , (, for . 7.4).

:

i ++; ( 1);

x + y; ( );

a = b c; .

. : (). , .

: , (), ().

, , -.

. , , { }, ; .

if .

: . :

if () ;

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

. 6.1.

 

if:

if (x > 0) x = 0;

if (i!= 1) j++, s = 1; ;

if (i!= 1) {

j++; s = 1; ();

}

if (getch()!= 27) k = 0; Esc .

if (!x) exit (1); if (x == 0) exit(1);

if (i>0 && i<n) k++; , ( );

if (a++) b++; .

:

if () 1;

else 2;

(), 1, 2. 1 2 ().

; else .

. 6.2.

 

:

if (x > 0) j = k+10;

else m = i+10;

if (x>0 && k!=0) {

j = x/k;

x += 10;

}

else m = k*i + 10;

1 2 , . , if else, else if, else. :

if (n > 0)

if(a > b) z = a;

else z = b;

else if (a > b). else if, :

if(n > 0) {

if(a > b) z = a;

}

else z = b;

if else if :

if ( 1) 1;

else

if ( 2) 2;

else

if ( 3) 3;

else 4;

- , . , . 4 , . , else , ( ).

:

if (x < 0) printf("\n X \n");

else if(x==0) printf ("\n X \n");

else printf("\n X \n");

. = == ( ). , :

if (x = 5) a ++;

, .. = 5 5¹0 .

 

6.3. ?:

, .. . :

1? 2: 3;

1 () (), 2, 3. 2 3.

. 6.3 , if (. . 6.2):

 

-.

z a b, if .

1. if:

if (a > b) z = a;

else z = b;

2. ,

z = (a > b)? a: b;

, . 2 3 , . , f double, n int,

(n > 0)? f: n;

double, , n .

. :

int a, x;

...

x = (a < 0)? a: a;

printf("\n %d %s !", x, (x? "": " "));

 





:


: 2016-11-12; !; : 1097 |


:

:

, ; , .
==> ...

1725 - | 1496 -


© 2015-2024 lektsii.org - -

: 0.021 .