#include<stdio.h>
bool isRelativeWith7(int m)
{
if (0 == m%7)
{
return true;
}
int temp = m;
while (0 != temp)
{
if (7 == temp % 10)
{
return true;
}
temp /= 10;
}
return false;
}
int main()
{
int N = 0;
int count =0;
scanf("%d", &N);
for (int i = 1; i <= N; ++i)
{
if (true == isRelativeWith7(i))
{
count ++;
}
}
printf("%d\n", count);
return 0;
}
挑7
最新推荐文章于 2021-09-02 10:43:27 发布