+ 2
How to print the count of no of articles in the string?
My program works fine when there is no comma or fullstop. Input I am a, active person in an, world the. output 3 my output 0 How can I print 3 https://code.sololearn.com/c989sOo7mmBo/?ref=app
4 ответов
+ 6
your program splits the input in words by spaces, so b will have the value of "a," instead of "a" and so on
+ 3
Thats because the comma, fullstop, semicolon, etc. are directly connected to the article. In normal phases the " " will seperate them. So just have to delete the symbols 😊
Or replace all your if statements like this:
strstr(b, "the") != NULL
+ 2
I got 2. That is strange. Wonder how. 🤔