![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
1 bool b = false; 2 for (int i = 1; i < 101; i++) 3 { 4 for (int j = 2; j < i; j++) 5 { 6 if (i%j == 0) 7 { 8 b = false; 9 break; 10 11 } 12 else 13 { 14 b = true; 15 } 16 } 17 if (b) 18 { 19 Console.WriteLine(i); 20 } 21 22 }
望高手指教
1 bool b = false; 2 for (int i = 1; i < 101; i++) 3 { 4 for (int j = 2; j < i; j++) 5 { 6 if (i%j == 0) 7 { 8 b = false; 9 break; 10 11 } 12 else 13 { 14 b = true; 15 } 16 } 17 if (b) 18 { 19 Console.WriteLine(i); 20 } 21 22 }
望高手指教
转载于:https://www.cnblogs.com/liyajie/p/3681997.html