Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- main()
- {
- int p,s,n;
- bool b;
- cin >> n;
- s=0;
- b=true;
- do
- {
- s = s + n % 10;
- p = n / 10 % 10;
- n = n / 10;
- if (p<=s)
- b = false;
- }
- while (b==true && n>10);
- if (b==true)
- cout << "Broj je dobar!" << endl;
- else cout << "Broj je los!" << endl;
- system ("PAUSE");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement