A small procedure for calculating the prime number.

xiaoxiao2021-03-06  102

Just started to learn C #, this is the first small and small applet: calculate the number. Don't be smirk! Http://true5460.muicc.com/program/calpn.zip The following is the source code: USING SYSTEM;

Class test {static void main () {ulong i; while (true) {console.write ("Please enter the number of columns to calculate (0 exit):"); i = convert.touint64 (console.readline ()); if (i == 0) Break; DateTime T1 = DATETIME.NOW; SWITCH (i) {case 1: console.writeline ("1 is not a rigidity!"); Break; Case 2: console.writeline ("2 is the number!" Break; default: Cal (i); break;} DateTime T2 = DATETIME.NOW; console.writeline ("time is: {0} milliseconds /n", (t2-t1 ).ticks/10000f);}}

// The following is the function part

Static void cal (ulong x) {ulong sum = 1; byte row = 1; console.write ("/ n"); for (Ulong a = 3; a

}

}

转载请注明原文地址:https://www.9cbs.com/read-105653.html

New Post(0)