100 Accepted
# | 状态 分数 | 耗时 | 内存占用 |
---|
#1 | Accepted 10 | 1ms | 7.4 MiB |
#2 | Accepted 10 | 1ms | 7.5 MiB |
#3 | Accepted 10 | 0ms | 7.5 MiB |
#4 | Accepted 10 | 1ms | 7.5 MiB |
#5 | Accepted 10 | 1ms | 7.6 MiB |
#6 | Accepted 10 | 0ms | 7.5 MiB |
#7 | Accepted 10 | 0ms | 7.6 MiB |
#8 | Accepted 10 | 1ms | 7.6 MiB |
#9 | Accepted 10 | 1ms | 7.6 MiB |
#10 | Accepted 10 | 1ms | 7.4 MiB |
代码
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n, flag = 0, sum = 0;
cin >> n;
for (int i = 1; i <= n; i++)
{
flag = 0;
int x = i;
while (x > 0)
{
if (x % 10 == 7)
{
flag = 1;
break;
}
x /= 10;
}
if (i % 7 != 0 && flag == 0)
{
sum += i * i;
}
}
cout << sum;
return 0;
}
信息
- 递交者
- 题目
- DJKS1083 与7无关的数
- 比赛
- 2024年3月等考一级题单
- 语言
- C++ 14
- 递交时间
- 11 个月前
- 评测时间
- 11 个月前
- 分数
- 100
- 总耗时
- 7ms
- 峰值内存
- 7.6 MiB