题目:http://118.190.20.162/view.page?gpid=T100
#include <bits/stdc++.h>
using namespace std;
bool check7(int x)
{
if(x%7==0)
return true;
string s=to_string(x);
for(int i=0;i<s.size();i++)
{
if(s[i]=='7')
return true;
}
return false;
}
int main()
{
ios::sync_with_stdio(false);
int n,a=0,b=0,c=0,d=0,count=0;
cin>>n;
for(int i=1;;i++)
{
if(i%4==1)
{
if(check7(i))
a++;
else
count++;
}
else if(i%4==2)
{
if(check7(i))
b++;
else
count++;
}
else if(i%4==3)
{
if(check7(i))
c++;
else
count++;
}
else if(i%4==0)
{
if(check7(i))
d++;
else
count++;
}
if(count>=n)
break;
}
cout<<a<<endl<<b<<endl<<c<<endl<<d;
return 0;
}