using System;
namespace Loops {
class Program {
static void Main(string[] args) {
/* local variable definition */
int i, j;
for (i = 2; i < 100; i++) {
for (j = 2; j <= (i / j); j++)
if ((i % j) == 0) break; // if factor found, not prime
if (j > (i / j)) Console.WriteLine("{0} is prime", i);
}
Console.ReadLine();
}
}
}
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/265877.html