题解:
#include<iostream>
using namespace std;
bool isok(int n)//判断数字是否需要跳过
{
if(n%7==0) return 1;
while(n>0)
{
int m=n%10;
if(m==7)
return 1;
n/=10;
}
return 0;
}
int main()
{
int n=0;
cin>>n;
int tiao[4]={0,0,0,0};
int tiaoguo=0,renci=0;
while(renci-tiaoguo!=n)//没有报够n个数
{
renci++;
int x=renci%4;
if(isok(renci))
{
tiaoguo++;
if(renci%4!=0)
tiao[x-1]++;
else tiao[3]++;
}
}
for(int i=0;i<4;i++)
{
cout<<tiao[i]<<endl;
}
return 0;
}