| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 134668 | 翁思宸 | 哪几扇门是打开的 | C++ | Accepted | 1 MS | 260 KB | 799 | 2025-10-31 19:07:21 |
/* //1457 输出回文数 #include<iostream> #include<cstdio> #include<cstring> #include<cmath> using namespace std; int main(){ int n=0,x=0,s=0,l=0; cin>>n; for(int i=1;i<=n;i++){ x=i; s=0; while(x!=0){ s=s*10+x%10; x/=10; } if(s==i){ cout<<i<<endl; } } return 0; }*/ //1458 哪几扇门是打开的 #include<iostream> #include<cstdio> #include<cstring> #include<cmath> using namespace std; int main(){ int a[101]={0},n=0,x=0,s=0,l=0; for(int i=1;i<=100;i++){ for(int j=i;j<=100;j+=i){ a[j]=!a[j]; } } for(int i=1;i<=100;i++){ if(a[i]==1){ cout<<i<<endl; } } return 0; }