namespace _032_練習(xí)5和6_for循環(huán)和循環(huán)的嵌套調(diào)用 {
? ? class program {
? ? ? ? static void main(string[] args) {
? ? ? ? ? ? for (int i = 1; i <= 100; i++)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? if ((i % 3 == 0) && (i % 5 != 0))
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? console.writeline(i);
? ? ? ? ? ? ? ? }
? ? ? ? ? ? }
? ? ? ? ? ? for (int i = 2; i < 1001; i++)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? bool iszhishu = true;
? ? ? ? ? ? ? ? for (int j = 2; j <= i - 1; j++)
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? if (i % j == 0)
? ? ? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? ? ? iszhishu = false;
? ? ? ? ? ? ? ? ? ? ? ? break;
? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? if (iszhishu)
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? console.writeline(i);
? ? ? ? ? ? ? ? }
? ? ? ? ? ? }
? ? ? ? ? ? console.readkey();
? ? ? ? }
? ? }
}