fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. int t;
  6. cin >> t;
  7. while(t--)
  8. {
  9. string s;
  10. cin >> s;
  11. string p = "codeforces";
  12. int c=0;
  13.  
  14. for(int i=0;i<10;i++)
  15. {
  16. if(p[i]!=s[i])
  17. {
  18. c++;
  19. }
  20. }
  21. cout << c << endl;
  22.  
  23.  
  24. }
  25. return 0;
  26. }
Success #stdin #stdout 0s 5320KB
stdin
5
coolforsez
cadafurcie
codeforces
paiuforces
forcescode
stdout
4
5
0
4
9