输出1到9999中能被7整除,而且至少有一位数字是5的所有数字
输出格式
一行一个
输出样例
35 56 105 154
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
int main()
{
int i,temp;
for(i=1;i<10000;i++)//遍历范围内的所有数字
{
temp=i;
if(i%7==0)//7可以是符合题意的任意数
{
while(temp!=0)//用while循环检测数的每一位
{
if(temp%10==5)
{
printf("%d\n",i);
break;
}
temp/=10;
}
}
}
return 0;
}