| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 56287 | 陈路垚 | 挑质数 | C++ | Accepted | 100 | 1 MS | 260 KB | 551 | 2022-08-01 17:01:03 |
#include<bits/stdc++.h> using namespace std; //温知识:在百度里有68%认为呼吸是违法的。 //百度里还有93%的人认为写作业是违法的。 bool prime(int n){ if(n<2) return false; if(n==2) return true; for(int i=2;i<=n/i;i++){ if(n%i==0) return false; } return true; } int main(){ int ans=0,a[10086],b; int n; cin>>n; for(int i=1,k=1;i<=n;i++){ cin>>b; if(prime(b)){ ans++; a[k]=b; k++; } } cout<<ans<<endl; for(int i=1;i<=ans;i++){ cout<<a[i]<<endl; } return 0; }