: 58 92480000000 .
, int uint.
byte sbyte. byte 0 255. byte , , . sbyte. , byte , 1 100.
// byte.
Using System;
class Use_byte {
static void Main() { byte x; int sum;
sum = 0;
for(x = 1; x <= 100; x++) sum = sum + x;
Console.WriteLine(" 1 100 " + sum);
}
}
.
1 100 5050
1 100, byte, .
, , byte sbyte, , int uint, short ushort.
. C# : float double. . , float 32 , 5-45 3,4+38. double 64 , 5-324
1,7+308.
C# double, , , #, .NET Framework, double. , Sqrt (), System. Math, double, double, . Sqrt () .
// .
Using System;
class FindRadius { static void Main() {
Double r;
Double area;
area = 10.0;
r = Math.Sqrt(area / 3.1416);
.
1.78412203012729
Sqrt (). , Sqrt () Math, * Math . Console WriteLine () . , , , .
|
|
, Math #. double. , , 0,1 1,0 .
// .
Using System;
class Trigonometry { static void Main() {
Double theta; //
for(theta = 0.1; theta <= 1.0;
theta = theta +0.1) {
Console.WriteLine(" " + theta +
" i " + Math.Sin(theta));
Console.WriteLine(" " + theta +
" " + Math.Cos(theta));
Console.WriteLine(" " + theta +
" " + Math.Tan(theta));
Console.WriteLine ();
}
}
}