//循环课件例题总结 package f.java; import java.util.Scanner; public class xunhuan0910 { public static void main(String[] args) { double i=100; if(i<100) { System.out.println(i); } else if(i>20) { System.out.println(i+1*2); } else if(i>150) { System.out.println(i+1*2); } //switch循环 int v=10; switch(v) { case 1: System.out.println("周1"); break; case 2: System.out.println("周2"); break; default: System.out.println("错误"); } //while循环 i=0; while(i<100) { System.out.println(i); i++; } //do while int g=10; do { System.out.println(g); g++; } while(g<20); for(;g<30;g++) { if(g==25) { break; } System.out.println(g); } } }