#include #include #define PUNT '.' #define SPATIE ' ' int main(){ int aantal = 0; char c; int endOfWord = 0; puts("Typ hier een willekeurige zin..\n"); while(c=getchar()){ if(c=='.'){ aantal++; break; } else if(endOfWord!=1&&(c==' '||c=='\n'||c==';'||c==','|| c=='?'||c=='!'||c=='-')){ aantal++; endOfWord=1; } else if(c==' '||c=='\n'||c=='.'||c==';'||c==','|| c=='?'||c=='!'||c=='"'||c=='-'); else { endOfWord=0; } } printf("Je hebt %d woorden ingetypt\n", aantal); system("PAUSE"); return EXIT_SUCCESS; }