Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream >
- int main()
- {
- int a, b;
- int s,s1 = 0;
- std::cout << "unesi broj : ";
- std::cin >> a;
- std::cout << b;
- std::cin >> b;
- while (a != 0) {
- s = s + a % 10;
- a = a / 10;
- }
- std::cin >> b;
- while (b != 0) {
- s1 = s1 + b % 10;
- b = b / 10;
- }
- if (s ==s1)
- {
- std::cout << "brojevi " << a << " i " << b << "imaju isti zbroj znamenki koji iznosi " << s << std::endl;
- }
- else { std::cout << "brojevi nemaju isti zbroj znamenki"; }
- std::cin.get();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement