public class ForDemo03 {
public static void main(String[] args) {
//用while或for循环输出1-1000之间能整除5的数,并且每行输出3个
for (int i = 0; i <= 1000; i++) {
if (i%5==0){
System.out.print(i+"\t");
}
if (i%(5*3)==0){
System.out.println();//换行
//或System.out.print("\n");
}
}
//println 输出完会换行
//print 输出完不会换行
}
}
09-01
07-31
1578
07-30
2295