| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 54736 | 杨竣周 | 挑质数 | C++ | Accepted | 100 | 0 MS | 256 KB | 367 | 2022-07-29 17:03:48 |
#include<bits/stdc++.h> using namespace std; int n,ans,a[1001]; bool func(int x){ if(x==1) return 0; for(int i=2;i<=x/i;i++){ if(x%i==0) return 0; } return 1; } int main(){ scanf("%d",&n); for(int c,i=1;i<=n;i++){ scanf("%d",&c); if(func(c)) a[++ans]=c; } printf("%d\n",ans); for(int i=1;i<=ans;i++) printf("%d\n",a[i]); return 0; }