fork download
  1. #define _CRT_SECURE_NO_WARNINGS
  2. #include <bits/stdc++.h>
  3. using namespace std;
  4.  
  5. int main() {
  6. ios::sync_with_stdio(false);
  7. cin.tie(nullptr) ;
  8. string s;
  9. cin >> s;
  10. int count = 0;
  11.  
  12. while (!s.empty() && s[0] != 'a') {
  13. s.erase(0, 1);
  14. count++;
  15. }
  16.  
  17. cout << s.length();
  18. return 0;
  19. }
Success #stdin #stdout 0.01s 5284KB
stdin
Standard input is empty
stdout
Standard output is empty