Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int calcul(int n, int a[100])
- {
- int c=0, d, div;
- for(int i=1; i<=n; i++)
- {
- div=0;
- for(d=2; d<a[i]/2; d++)
- {
- if(a[i]%d==0)
- div++;
- }
- if(div==0)
- c++;
- }
- return c;
- }
- int main()
- {
- int n=5, a[100]={12,37,43,6,71};
- cout<<calcul(n,a);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement