Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- //
- //char s[10];
- //scanf("%9s", s);
- //ana are mere -> 3
- //ana are mere -> 3
- //ana are.mere -> 2
- // a na are mere -> 3
- /*
- while(nu am terminat inputul){
- while (spatiu) skip
- countWord
- while (!spatiu) skip
- }
- */
- int main(){
- unsigned nWord=0;
- int c=1;
- while (c!=EOF){
- while ((c=getchar())==' ');
- if (c!='\n') nWord++;
- while (((c=getchar())!=' ') && (c!=EOF));
- if (c==EOF) printf("am gasit capat");
- }
- printf("Am gasit %d cuvinte", nWord);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement