SHARE
TWEET

Untitled

a guest Oct 14th, 2019 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. using namespace std;
  3. int n,v[100],i,p,d,s;
  4. int prim(n)
  5. {for(i=1;i<n;i++)
  6. cin>>v[i]; cout<<"v["<<i<<"]=";}
  7. {for(d=2;d<=v[i]/2;d++)
  8. if(v[i]%d==0) cout<<"Nu este prim";
  9. else return p=p+1;}
  10. for(s=2;s<=p/2;s++)
  11.     if(p%s==0) cout<<"p nu este prim";
  12. else cout<<"p este prim";
  13.  
  14.  
  15. int main()
  16. {int n;
  17. cin>>n; cout<<"n=";
  18. cout<<prim(n);
  19.  
  20.     return 0;
  21. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top