Advertisement
naskedvi

S1 - zad.3 (...)

Mar 2nd, 2014
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. int main()
  4. {
  5. int broj;
  6. std :: cout << "Unesi broj:" << std :: endl;
  7. for(;;){
  8. std :: cin >> broj;
  9. if(std:: cin) break;
  10. std:: cout << "Unesi ponovo broj:" << std :: endl;
  11. std:: cin.clear();
  12. std:: cin.ignore(1000, '\n');
  13. }
  14. if(broj==(int)broj && broj>0)
  15. std:: cout << "Broj je prirodan" << std :: endl;
  16.  
  17. return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement