| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 54827 | 石利伟 | 挑质数 | C++ | Accepted | 100 | 3 MS | 248 KB | 426 | 2022-07-29 17:24:39 |
#include<bits/stdc++.h> using namespace std; int ans[20000],c,counter; bool flag; int main(){ int n; cin>>n; for(int i=0;i<n;i++){ flag=true; int o; cin>>o; if(o==1)continue; for(int j=2;j<o;j++){ if(o%j==0){ flag=false; break; } } if(flag){ c++; ans[counter]=o; counter++; } } cout<<c<<endl; for(int i=0;i<c;i++){ cout<<ans[i]<<endl; } return 0; }