| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 54635 | 李言 | 挑质数 | C++ | Accepted | 100 | 1 MS | 260 KB | 364 | 2022-07-29 16:35:54 |
#include<bits/stdc++.h> using namespace std; int n,b[1001],k=0; int zhishu(int x){ if(x==0||x==1) return 0; for(int i=2;i<=x/i;i++){ if(x%i==0) return 0; } return 1; } int main(){ cin>>n; for(int i=1;i<=n;i++){ int a; cin>>a; if(zhishu(a)) b[++k]=a; } cout<<k<<endl; for(int i=1;i<=k;i++){ cout<<b[i]<<endl; } return 0; }