public class test1{
public static void main(String[] args) {
test2();
}
public static void test2() {
//問題4 AとBが交互に出る無限ループを作ってください。
for(int d = 0; ; d++) {
if(d % 2 == 0) {
System.out.println("A");
}else{
System.out.println("B");
}
}
}
}
▪️実行結果
A
B
A
B
A
B
A
B
A
B
A
B
A
B
A
B
・
・
・
・
・
More than 5 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme