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, x, d, i, r, diviz=0, cate=0;
- cin>>n;
- for(i=1; i<=n; i++)
- {
- r=0;
- cin>>x;
- r=sqrt(x);
- for(d=2; d<=r; d++)
- {
- if(x%d==0)
- {
- diviz++;
- break;
- }
- }
- if(diviz==0)
- {
- cate++;
- }
- diviz=0;
- }
- cout<<cate;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement