fork download
  1. #include <stdio.h>
  2. //Lorenzo Borsello 2SC
  3. //Programma che legge il numero di carattere scelto presente in un testo
  4. int main(void) {char car; int i; int n=0; char vett[2];
  5. for(i=0;i<1000;i++)
  6. {scanf("%c", &vett);
  7. scanf("%c", &car);
  8. if(car=='vett') n=n+1;
  9. }
  10. printf("ci sono %d %c", n, vett);
  11. return 0;
  12. }
  13.  
Success #stdin #stdout 0s 5288KB
stdin
ei ciao come stai
stdout
ci sono 0