fork download
  1. #include <iostream>
  2. #include <cstring>
  3. using namespace std;
  4.  
  5. int main() {
  6. string s;
  7. int r = 0;
  8. getline(cin, s);
  9. if(s.find('f') == -1) return 0;
  10. r = s.find('f');
  11. for(int i = 0; i < s.size(); i++)
  12. {
  13. if(s[i] == 'f') r = i;
  14. }
  15. cout << s.find('f');
  16. if(r != s.find('f')) cout << " " << r;
  17. return 0;
  18. }
  19.  
Success #stdin #stdout 0s 4408KB
stdin
comfort
stdout
3