Advertisement
Guest User

Untitled

a guest
May 20th, 2019
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. int prim(int n)
  5. {
  6. bool OK=true;
  7. if(n<2)
  8. OK=false;
  9. else if(n!=2 && n%2==0)
  10. OK=false;
  11. for(int d=3;d*d<=n && OK==true;d+=2)
  12. {
  13. if(n%d==0)
  14. {
  15. OK=false;
  16. }
  17. }
  18. if(OK==false)
  19. return 0;
  20. else
  21. return 1;
  22. }
  23. int main()
  24. {
  25. int n, v[101], sorted[101];
  26. cin>>n;
  27. for(int i=1;i<=n;i++){
  28. cin>>v[i];
  29. sorted[k]=v[i];
  30. }
  31. return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement