Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n, c, nr0, nr1;
- cin >> n;
- nr0 = nr1 = 0;
- while (n > 0 && n % 10 <= 1)
- {
- c = n % 10;
- if (c == 0) nr0++;
- else nr1++;
- n /= 10;
- }
- if (n == 0 && nr0 > 0 && nr1 > 0)
- cout << "da";
- else cout << "nu";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement