fork download
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. char str[20];
  5. fgets(str, 18, stdin);
  6. for (int i = 0; str[i]; i++) {
  7. if (str[i] == 'c') printf("Achei");
  8. printf("[%c]", str[i]);
  9. }
  10. }
  11.  
  12. //https://pt.stackoverflow.com/q/433537/101
Success #stdin #stdout 0s 4444KB
stdin
teste para achar c
stdout
[t][e][s][t][e][ ][p][a][r][a][ ][a]Achei[c][h][a][r][ ]