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