fork(2) download
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <string>
  4. #include <vector>
  5. #include <cmath>
  6. using namespace std;
  7.  
  8. int main() {
  9. //ios::sync_with_stdio(0); cin.tie(0);
  10. vector<int> v(9);
  11. string s;
  12. int n;
  13. cin >> s;
  14. for(char c : s) {
  15. n = atoi(&c);
  16. if (n == 9) v[6]++;
  17. else v[n]++;
  18. }
  19. v[6] = round(v[6] / 2.0l);
  20. auto it = max_element(v.begin(), v.end());
  21. cout << *it;
  22. return 0;
  23. }
Success #stdin #stdout 0s 4284KB
stdin
Standard input is empty
stdout
Standard output is empty