| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 56170 | 王籽易 | 挑质数 | C++ | Accepted | 100 | 1 MS | 256 KB | 391 | 2022-08-01 16:00:28 |
#include <bits/stdc++.h> using namespace std; int n,ans=0,a[10000]; bool f(int a){ if(a==1) return 0; if(a==2) return 1; for(int i=2;i<=a/i;i++){ if(a%i==0) return 0; } return 1; } int main(){ cin>>n; for(int i=1;i<=n;i++){ int t; cin>>t; if(f(t)){ a[++ans]=t; } } cout<<ans<<endl; for(int i=1;i<=ans;i++){ cout<<a[i]<<endl; } return 0; }