Advertisement
TareSedam

Untitled

Feb 14th, 2016
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. bool Suma(int n) {
  4. int ost = 0;
  5. int br = 0;
  6. int s = 0;
  7. do {
  8. ost = n % 10;
  9. n /= 10;
  10. s += pow(ost, 3.0);
  11. if (s == n)
  12. return true;
  13. return false;
  14. } while (n != 0);
  15. }
  16. void main() {
  17. int n;
  18. cout << "Unesi:" << endl;
  19. do {
  20. cin >> n;
  21. if (Suma(n == true))
  22. cout << "Jeste AB." << endl;
  23. else
  24. cout << "NIJE." << endl;
  25. } while (n > 0);
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement