Created
December 4, 2014 14:17
-
-
Save savaryna/81e684577cdf96b42223 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <conio.h> | |
#include <stdio.h> | |
#include <string.h> | |
// Numara cite cuvinte sunt in sir | |
void main() | |
{ | |
int c=0; | |
char str[1024]; | |
char* p; | |
printf("\nIntroduceti un sir de caractere si apoi apasati Enter\n"); | |
gets(str); | |
p=strtok(str," "); | |
while (p!=NULL) | |
{ | |
p=strtok(NULL, " "); | |
c++; | |
} | |
printf("\nNumarul de cuvinte este: %d",c); | |
getch(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment