# include
using namespace std;
Int main (int arg c, char * * argv) {
String STR.
Int count=0;
Getline (cin, STR);
For (int I=STR. The size () - 1; I> 0; - I)
{
If (STR [I]==' ')
{
break;
}
+ + count;
}
cout
}
Very depressed, why in OJ platform will pass?
CodePudding user response:
Only one word is wrong, instead I=len - 1; I>=0CodePudding user response:
First of all, when there is only one word, it is a little one;Secondly if your program does not analysis exist other Spaces after the last word;
Overall robustness is poor; Huawei OJ above, of course, might not consider so much, see the comments when little detours to solve the problem