文章
43
粉丝
180
获赞
21
访问
196.1k
#include <iostream>
using namespace std;
int n;
bool judge(int x)
{
if (x % 7 == 0) return true;
for (; x; x /= 10) if (x % 10 == 7) return true;
return false;
}
int main()
{
while (cin >> n)
{
int res = 0;
for (int i = 1; i <= n; i ++ )
if (!judge(i)) res += i * i;
cout << res << endl;
}
return 0;
}
登录后发布评论
暂无评论,来抢沙发