public class ex4 {
private static int i;
/**
* 打印1-100之间所有不是7的倍数和不包含7的数字,并求和。并在程序的末尾输出自己的"班级-学号-姓名”
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int sum=0;
for (int i = 1; i <= 100; i++)
{
int b = i / 100;
int s = (i-b*100) / 10;
int g = (i-b*100-s*10);
if (i % 7 == 0 || b == 7 || s == 7 || g == 7)
{
continue;
}
sum+=i;
System.out.println(i);
}
System.out.println("sum= "+sum);
}
}