题解 | #KiKi求质数个数#
KiKi求质数个数
https://www.nowcoder.com/practice/d3a404ee0f8d41f98bf4707035d91086
public class Program { public static void Main() { int num = 0, i = 0; for (int m = 100; m <= 999; m++) { for ( i = 2; i < m; i++) //能整除说明不是质数 if (m % i == 0) break; //到自己并且前面没有整除 if (m == i) num++; } System.Console.WriteLine(num); } }