Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <string>
- using namespace std;
- int main(){
- ios::sync_with_stdio(false);
- cin.tie(nullptr);
- string s;
- cin >> s;
- int m = 0;
- for (int i = 0; i < s.length(); ++i) {
- if (s[i] == '9' || s[i] == '6' || s[i] == '4' || s[i] == '0') m++;
- if (s[i] == '8') m+=2;
- }
- cout << m;
- return 0;
- }
Add Comment
Please, Sign In to add comment