Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(void){
- char c;
- int ch=0, wd=0, ro=0;
- printf("Inserisci il testo da esaminare");
- while(c != EOF){
- c=getchar();
- if (c == '\n'){
- ro++;
- wd++;
- }
- if (c == ' ' || c == '\t'){
- wd++;
- }
- ch++;
- }
- printf("Numero di caratteri: %d\nNumero di parole:%d\nNumero di righe:%d", ch, wd, ro);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement