代码找不出错误在哪
原题在http://noi.openjudge.cn/ch0107/24/
#include <stdio.h>
#include <string.h>
int main(){
char s[1000][999]={'\0'},ch;
int op=0,oq=0,i,t,e=0;
while(scanf("%c", &ch),ch!='\n')
{
if(ch==' '){
op++;
oq=0;
}
else{
s[op][oq++]=ch;
}
}
for(i=0;i<=op;i++){
if(s[i][0]=='\0') continue;
t=strlen(s[i]);
if(e==0){
printf("%d", t);
e=1;
}
else{printf(",%d", t);}
}
return 0;
}