Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstring>
- using namespace std;
- int main()
- {
- int rez = 0;
- char text[101] = "grus leucogeranus are 1,40 m inaltime si traieste intre 30 si 40 de ani";
- char *cuvant = strtok(text, " ");
- while(cuvant != NULL)
- {
- if(cuvant[0] >= '1' && cuvant[0] <= '9')
- {
- if(strchr(cuvant, ',') == NULL)
- rez++;
- }
- cuvant = strtok(NULL, " ");
- }
- cout << rez;
- return 0;
- }
Add Comment
Please, Sign In to add comment