.


:




:

































 

 

 

 


(break, continue, return, goto). , , .




break

break , , . break, , , .

int i;

for (i = 0; i < 10; i++)

{

if (i > 5)

break;

System.Console.WriteLine("{0}",i);

}

System.Console.ReadLine();

0 1 2 3 4 5

continue

continue . continue , , . , continue break.

for (int i=1; i<=10; i++)

{

if (i<9)

{

continue;

}

Console.WriteLine(i);

}

return

return . . return: void, .. , , , .

class ReturnTest

{

static double CalculateArea(int r)

{

double area = r*r*Math.PI;

return area;

}

static void Main()

{

int radius = 5;

double result = CalculateArea(radius);

Console.WriteLine(The area is {0:0.00}, result);

Console.WriteLine(Press any key to exit.);

Console.ReadKey();

}

}

goto

# goto . goto, , . " " . goto , . goto # . , goto, .

goto:

class Program

{

static void Main(string[] args)

{ // for 1 5

Console.WriteLine(" for:");

for (int i = 1; i <= 5; i++)

Console.Write("\t{0}",i); // goto

Console.WriteLine("\n\n goto:");

int j = 1;

link1:

Console.Write("\t{0}",j);

j++;

if (j <= 5) goto link1;

Console.ReadLine();

}

}

}

Math. , . .

, . Math System , . , : double, float, int .. , E PI, 23 . :

- Sin, Cos, Tan;

- ASin, ACos, ATan, ATan2 (sinx, cosx);

- Tanh, Sinh, Cosh;

- Exp, Log, Log10;

, , - Abs, Sqrt, Sign;

- Ceiling, Floor, Round;

, , , - Min, Max, Pow, IEEEReminder.

double angle = 180.0;

double sinAngle = Math.Sin(angle);

double cosAngle = Math.Cos(angle);

double res;

// res = (cos(angle) + x2)/(angle + 1)

res = (Math.Cos(angle) + Math.Pow(x, 2))/(Math.Sqrt(angle) + 1);





:


: 2017-03-18; !; : 991 |


:

:

, ,
==> ...

1625 - | 1537 -


© 2015-2024 lektsii.org - -

: 0.007 .