, , Main (), - . , .
Main ()
, .. , . C# Main (). Main ().
static void Main(string[ ] args) static int Main(string[ ] args)
Main () void, , . string, Main (). (args) , .
, , .
// .
Using System;
class CLDemo {
static void Main(string[] args) {
Console.WriteLine(" " + args.Length +
" .");
Console.WriteLine(" : ");
for(int i=0; i < args.Length; i++)
Console.WriteLine(args[i]);
}
}
CLDemo : CLDemo
.
3 .
:
, , , . . . 1. , "" "" .. 1. , , . .
// , // .
Using System;
class Cipher {
static int Main(string[] args) {
// , if(args.Length < 2) {
Console.WriteLine(": " +
"1: <>/<> " +
"[2... ]"); return 1; //
}
// , // <> <>. if(args[0]!= "" & args[0]!= "") {
|
|
Console.WriteLine(" " + "<> <>."); return 1; //
}
}
Console.Write(" ");
}
Console.WriteLine(); return 0;
}
}
, , "" "" , . , , Cipher.
C:\Cipher
C:\Cipher
. -, , , . ,
. , , . , , . , "" "" .
-, , . , 1, . 0, .
C# , . , , , . , , . - . , , . .
. N 1 N. , 3 12><3, 6. . .
// .
Using System;
class Factorial {
// , public int FactR(int n) { int result;
if(n==l) return 1; result = FactR(n-l) * n; return result;
}
// , public int FactI(int n) { int t, result;
result = 1;
for(t=l; t <= n; t++) result *= t; return result;
class Recursion {
static void Main() { Factorial f = new
Factorial ();
Console.WriteLine(", . Console.WriteLine(" 3 " + f.FactR(3));
|
|
4 " + f.FactR(4));