5 " + f.FactR(5));
Console.WriteLine();
Console.WriteLine(", Console.WriteLine(" 3 " + f.FactR(3));
Console.WriteLine(" 4 " + f.FactR(4));
Console.WriteLine(" 5 " + f.FactR(5));
.
, .
3 6 4 24 5 120
, .
FactI () . , , 1, , , .
FactR () . FactR () 1, 1. FactR (-1) *. FactR () -1. , 1, . , 2, FactR () 1. 1, 2 ( ). 2, 2 (1x2). FactR () , WriteLineO, FactR (), .
, , . , . , . .
.
DisplayRev().
// , .
Using System;
class RevStr {
// , public void DisplayRev(string str) { if (str.Length > 0)
DisplayRev(str.Substring(1, str.Length-1)); else
Return;
Console.Write(str[0]);
}
}
class RevStrDemo { static void Main() {
|
|
string s = " ";,
RevStr rsOb = new RevStr ();
Console.WriteLine(" : " + s);
Console.Write(" : "); rsOb.DisplayRev(sf;
Console.WriteLine();
}
}
.
: :
, DisplayRev (), , str. , DisplayRev () , . , . DisplayRev (). , s t , .
, - . , . , - . , (CLR) . , .
, , . , . , , , .
, i f, . . . , WriteLine (), , .
static
, . , , . , static. static, - . static , . static Main (), , .
|
|
static , -. . static , . , 10 count static, Timer, .
Timer.count = 10;
, , , . static, -.,
, static, , . , , static . static. . , , , , , false, bool. , static - .
static , , . . Sqrt () static, System.Math #.