.


:




:

































 

 

 

 





. . .

# : , , . , . . , . , , . , . . . . .

. . . . - .

. , {} . .

{ }

 

:

,

, . : , , , .

 

 
 


If ( P)

1

Else

2

 

, . .

.

If (P) ;

1 2 - , , :

1) C# (= + ;)

2) , , {f=d+c; r+=3;}

, , , , . :

if (a= =c) Console.WriteLine(b);

, , b .

:

if (a!= s)

{Console.WriteLine(b); a+=4;}

a s, b 4.

( P). (), :

1) ();

2) ().

: true false. , bool. , . .

:

,

x2, <0

y=

+10, ≥0

:

double x, y;

x = double.Parse(Console.ReadLine());

if (x < 0)

y = x * x;

else

y = x + 10;

. . .

double x, y;

x = double.Parse(Console.ReadLine());

y = 0.0;

if (x < 0)

y = x * x;

if (x>=0)

y = x + 10;

(!), (&&) (| |). . ( ) . :

1. . ,

bool a=true, b=false; int w=2;

if (!b) w++;

b () . , , .. w++;// 3

2. 1 () , .

bool a=true, b=false; int w=2;

if (b && a) w++;

, . , , .

3. 1 () , .

bool a=true, b=false; int w=2;

if (b || a) w++;

, w++;

# : , 0, :

if (-5) //

if (1) //

if (5-5) //

, , . ( ) - . , : , . , . : , , , . , ( ).

( ), .

 

- break;

- continue;

-

goto_;

: ;

- return;

, 1 4, 0 9. , . 5.

 

 
 


1 0 11 12 19 b

2 0 21 22 29

3 0 31 32 39

4 0 41 42 49

a

public static void Main()

{

int a, b, c;// , ,

for (a=1; a<=4; a++)

for (b=0; b<=9; b++)

{

c=a*10+b;

if (c%5!=0) continue; // 5,

Console.Write (c.ToString()+ );

//break;

//goto_EXIT;

//return;

}

EXIT: Console.WriteLine (\n!);

}

10 15 2025 30 35 40 45

!

break;

break , 5.

 

10 20 30 40

!

break goto_EXIT. , 5, EXIT:

!

- .

 

c return goto EXIT. , 5, return. Main(), .

: , . , continue .

. . , .

switch ( )

, , char

{

case_: ; break;

case_: ; break;

<default: ; break;> //

}

:

1. .

2. .

3. , .

default. , , .

() . : ( case_:) break, ( ) . break , , , .

.

, . . , , {I, V, X}. , , :

char symbol='s';

switch (symbol)

{ case 'I': Console.WriteLine(" I well ");

case 'V': Console.WriteLine(" V well ");

case 'X': Console.WriteLine(" I well ");

default:

Console.WriteLine(" No well {0:c}", symbol); break;

}

symbol s. . () . , s. , No well s :

V :

V well

I well, .. , .. . , break.

, . break; ( break ).

 

char symbol='s';

switch (symbol)

{ case 'I': Console.WriteLine(" I well "); break;

case 'V': Console.WriteLine(" V well "); break;

case 'X': Console.WriteLine(" I well "); break;

default:

Console.WriteLine(" No well {0:c}", symbol); break;

}

V ( char symbol= V ';)

V well

, :

int chislo=2;

switch (chislo)

{ case 1: Console.WriteLine(" I well "); break;

case 2: Console.WriteLine(" V well "); break;

case 3: Console.WriteLine(" I well "); break;

}

V well

, . ! 12, 12.2, r .

 





:


: 2017-01-21; !; : 651 |


:

:

, .
==> ...

1757 - | 1578 -


© 2015-2024 lektsii.org - -

: 0.055 .