Guest User

Untitled

a guest
May 22nd, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #include <cstdlib>
  2. #include <iostream>
  3. #include <conio.h>
  4.  
  5. using namespace std;
  6.  
  7. int main(int argc, char *argv[])
  8. {
  9. int lpierwsza, i =2;
  10. cout << "Podaj liczbe, ktora chcesz zbadac: ";
  11. cin >> lpierwsza;
  12. if(lpierwsza==1){
  13. cout << "NIE";
  14. }
  15. while((lpierwsza%i)!=0)
  16. {
  17. i=i+1;
  18. }
  19. if(i==lpierwsza)
  20. cout << "TAK";
  21. else
  22. cout << "NIE";
  23.  
  24. getch();
  25. }
Add Comment
Please, Sign In to add comment