limun11

Untitled

Jan 20th, 2016
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int broj = 1, pohrana, temp, kvadrat;
  7.  
  8. while (broj < 1500)
  9. {
  10. pohrana = broj % 10;
  11. broj++;
  12. if (pohrana == 2)
  13. {
  14. temp = broj;
  15. kvadrat = broj*broj;
  16. if (kvadrat == broj)
  17. {
  18. cout << kvadrat << endl;
  19. }
  20. else
  21. broj = broj / 10;
  22. }
  23. }
  24.  
  25. system("PAUSE");
  26. return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment