Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
2792 | 孙浚轩 | 哪几扇门是打开的 | C++ | Accepted | 0 MS | 252 KB | 332 | 2024-02-24 18:30:15 |
#include<iostream> using namespace std; void opposite(bool &f){ if(!f) f=1; else f=0; } int main(){ bool f[101]={0}; for(int i=1;i<=100;i++){ for(int j=i;j<=100;j+=i) opposite(f[j]); } for(int i=1;i<=100;i++) if(f[i]) cout<<i<<" "; return 0; }