Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<cmath>
- using namespace std;
- int main()
- {
- int i, n, x, okey, contor=0, d, r;
- cin>>n;
- for(i=1; i<=n; i++)
- {
- okey=0;
- cin>>x;
- r=sqrt(x);
- for(d=2; d<=r; d++)
- {
- if(x%d==0)
- {
- okey=1;
- break;
- }
- }
- if(okey==0 && n>1)
- {
- contor++;
- }
- }
- cout<<contor;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement