#4815: WA!! 請問這樣哪裡錯了?


matt9836matt (小搏)


與正確輸出不相符(line:1)
您的答案為: 2
正確答案為: 11

以下是我的code:

#include <iostream>
#include <cctype>
using namespace std;

int main()
{
char a[1000];
int b;
while(cin >> a){
b=1;
for(int i=0; i<1000; i++){
if(isalpha(a[i])==false)
b++;
if(isalpha(a[i])==false && isalpha(a[i+1])==false)
goto zxc;
}
zxc: ;
cout << b << endl;
}
}