7 题解:
#include<iostream>
using namespace std;
int n,res;
bool check(int x)
{
if(x%7==0)
return true;
while(x)
{
if(x%10==7)
return true;
x/=10;
}
return false;
}
int main()
{
while(cin>>n)
{
res=0;
for(int i=1;i<=n;i++)
if(!check(i))
res+=i*i;
cout<<res<<endl;
}
return 0;
}
登录后发布评论
暂无评论,来抢沙发