2026.10.13

This commit is contained in:
2026-10-13 16:56:20 +09:00
parent d9529e2971
commit 6e9775e57f
42 changed files with 505 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
public class Question06 {
public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
//設問1
for(int i = 0; i <= 99; i++) {
System.out.println(i);
}
//設問2
for(int i = 0; i <= 5; i++) {
System.out.print("■");
}
//設問3
for(int i = 0; i <= 100; i++) {
//偶数の判定
if(0 == (i%2))
System.out.println(i);
}
//設問4
for(int i = 1; i <= 49; i++) {
if(i % 3 == 0 && i % 5 == 0)
System.out.println("fizzbuzz");
else if(i % 3 == 0)
System.out.println("fizz");
else if(i % 5 == 0)
System.out.println("buzz");
else
System.out.println(i);
}
for(int i =0; i <= 2; i++);
}
}