用for或while输出0-1000之间能被5整除的数,并且每行输出三个
作者:互联网
package struct; public class ForDemo3 { public static void main(String[] args) { //用for或while输出0-1000之间能被5整除的数,并且每行输出三个; for (int i = 1; i <= 1000; i++) { if(i%5==0){ System.out.print(i+"\t"); } if(i%(5*3)==0){ System.out.println(); } } } }
标签:输出,每行,while,整除,public,1000 来源: https://blog.csdn.net/qq_49408450/article/details/122749108