#include<stdio.h>
int main()
{
int i;
int a,b,c;
int sum = 0;
for(i = 100;i < 1000;i++){
a = i /100;
b = (i % 10) / 10;
c = i % 10;
if(((i % 7) == 0)){
if((a == 3) || (b == 3) || (c == 3)){
printf("i is %d\n",i);
sum += i;
}
}
}
printf("sum is %d\n",sum);
return 0;
}
求能被7整除且至少有一位数字为3的三位数
最新推荐文章于 2023-09-17 21:26:40 发布