packagepracticeGO;/* * 2.输出1——100之间的奇数,每行输出5个数字 */publicclassCto{publicstaticvoidmain(String[]args){intj=0;for(inti=1;i<=100;i++){if(i%2!=0){j++;System.out.print(i+" ");if(j%5==0){System.out.print("\n");}}} 1. 2. 3. 4. 5. 6. 7. 8. 9. 10...
public class Test1{ public static void main(String[] args) { int i =1;while(i<=15){ //判断i是否能被3整除(i除以3 ,取余,若余数为0,则表示能整除)if(i%3==0){ System.out.println(i);} //改变i的值(1--100)i++;} } } ...