Advertisement
Guest User

Untitled

a guest
Nov 26th, 2014
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. #include <cstdlib>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9. int n,i;
  10. cout << "Podaj n " << endl;
  11. cin >>n;
  12. i=2;
  13. while (i<n)
  14. {
  15. if(n%i==0)
  16. {
  17. cout << "nie "<<endl;
  18. return 0;
  19. }
  20.  
  21. else
  22.  
  23. i=i+1;
  24. }
  25. cout <<" tak ";
  26. return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement