//求一个三位数的各数位满足条件的数的和
System.out.print("请输入一个三位数:");
int a = sc.nextInt();
int sum0 = 0;
for (int i = 100; i <= a; i++) {
if(a < 100 || a > 999) {
System.out.println("输入有误!");
break;
} else {
int w1 = i % 10;
int w2 = (i / 10) % 10;
int w3 = i / 100;
if (w1 != 7 && w2 != 5 && w3 != 3) {
sum0 += i;
}
}
}
if (a >= 100 && a <= 999){
System.out.println("满足条件的三位数的和为sum0:" + sum0);
}
System.out.println("--------------------");
// switch语句的循环
while (true) {
System.out.print("请输入一个1-5的整数:");
int num = sc.nextInt();
switch (num) {
case 1:
System.out.println("新建");
break;
case 2:
System.out.println("打开文件");
break;
case 3:
System.out.println("保存");
break;
case 4:
System.out.println("刷新");
break;
case 5:
System.out.println("退出");
System.exit(0);
break;
default:
System.out.println("输入有误!");
break;
}
}
}
}