每日总结21

package test01;
public class test01 {
public static void main(String[] args) {
int count=0;
for(int x=4;x<7;x++) {
for(int y=4;y<7;y++) {
for(int z=4;z<7;z++)
{
if(x*100+y*10+z>1000||(x==y||x==z||y==z))
continue;
count++;
System.out.println(x*100+y*10+z);
}
}
}
System.out.println("共有"+count+"个三位数");
}
}

一段代码,作用是用4567四个数字写出所有可以组成的无重复三位数,并统计数量打印输出

posted @ 2021-10-09 22:17  热爱代码的某人  阅读(18)  评论(0编辑  收藏  举报