+ 2
What Is Wrong In My Code Coach Averange Code Length
#include <iostream> #include <string> #include <cmath> using namespace std; int main(){ string kata; string awe; float huruf = 0 , spasi = 0; getline(cin,kata); for(int i=0;i<kata.length();i++){ awe = kata[i]; if(awe != " "){ huruf++; }else if(awe == " "){ spasi++; } } cout << ceil((huruf)/(spasi+1)) << endl; return 0; } What is wrong in my code
1 Answer
+ 1
Your program counts punctuations also. Which according to the question statement should be removed from the input before evaluation