+ 2
Where I am wrong? The task is to find the average word length... can you fix my code plz?
Takes in a string, figure out the average length of all the words and return a number representing the average length. Remove all punctuation. Round up to the nearest whole number. Input Format: A string containing multiple words. Output Format: A number representing the average length of each word, rounded up to the nearest whole number. Sample Input: this phrase has multiple words Sample Output: 6 https://code.sololearn.com/ck875H4iRCt0/?ref=app
3 Antworten
+ 3
RLB ,
the conditional should include the letters a, A and also z, Z:
if(c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z')
+ 3
Yeah you are right guys, I fixed it already but thank you anyway !!!!
+ 2
Only thing what I see:
What about this?
c>='a' && c<='z' || c>='A' && c<='Z')
Added some '='