Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- int main()
- {
- int n, v[201],ok,c,i,d;
- cin>>n;
- for(i=1;i <=n;i++)
- cin>>v[i];
- c=0;
- for (i=1;i <=n;i++){
- ok=1;
- if (v[i]==0||v[i]==1)
- ok=1;
- int x = sqrt(v[i]);
- if(v[i]%2 == 1){
- for (d=3;d<=x;d+=2){
- if (v[i]%d == 0){
- ok=0;
- }
- }
- }
- else{
- ok=0;
- }
- if (ok == 1)
- c++;
- }
- if (c==0)
- cout <<"NU";
- else
- cout <<"DA";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement