Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- bool Suma(int n) {
- int ost = 0;
- int br = 0;
- int s = 0;
- do {
- ost = n % 10;
- n /= 10;
- s += pow(ost, 3.0);
- if (s == n)
- return true;
- return false;
- } while (n != 0);
- }
- void main() {
- int n;
- cout << "Unesi:" << endl;
- do {
- cin >> n;
- if (Suma(n == true))
- cout << "Jeste AB." << endl;
- else
- cout << "NIJE." << endl;
- } while (n > 0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement