个人笔记
1.while循环
public class Main {
public static void main(String[] args){
int count =0;
while (count <6 ){
System.out.println("加油打气中");
count += 2;
}
}
}
do while 循环,至少循环一次。
先运行条件,在进行循环
public class Main {
public static void main(String[] args){
int count =0;
do {
System.out.println("hahha");
count += 1;
}while (count < 6);
}
}
for循环
public class Main {
public static void main(String[] args){
for (int i =0; i<9;i++){
System.out.println("加油");
}
}
}