Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
40002 | teacher_lu | 与7无关的数 | C++ | Accepted | 1 MS | 240 KB | 297 | 2024-02-06 20:05:29 |
#include <bits/stdc++.h> using namespace std; int main(){ int sum=0; int n; cin>>n; int i=1; while(i<=n){ int a=i%10; // 个位 int b=i/10; // 十位 if(a!=7 and b!=7 and i%7!=0){ sum=sum+(i*i); } i++; } cout << sum; return 0; }