#include <iostream>
#include <algorithm>
#include <queue>
#include <vector>
#include <cstring>
#include <stack>
#include <string>
#include <string.h>
#include <stdio.h>
#include <cmath>
#include <map>
#include <functional>
#include <set>
#include <limits.h>
#include <math.h>
#include <ctype.h>
using namespace std;
//1132
int n;
bool fuck(int n)
{
if(n%7==0)
return true;
while(n){
int t=n%10;
if(t==7) return true;
n/=10;
}
return false;
}
long long int ans;
int main()
{
while(cin>>n)
{
ans=0;
for(int i=1;i<n+1;i++)
if(!fuck(i))
ans+=i*i;
cout<<ans<<endl;
}
return 0;
}
/**************************************************************
Problem: 1132
User: cust123
Language: C++
Result: Accepted
Time:10 ms
Memory:1520 kb
****************************************************************/
题目1132:与7无关的数
最新推荐文章于 2024-08-16 08:15:00 发布