|
|
вернуться в форумHelp me please..!! #include <stdio.h> #include <string.h> void main() { int i,wrong,beg,len; char a[11000]; scanf("%[ A-Za-z.,;:-!?\n]s",a); len=strlen(a); wrong=beg=0; for(i=0;i<len;i++) { if(a[i]=='\n') a[i]=' '; if(a[i]=='.'||a[i]==','||a[i]==':'||a[i]==';'||a[i]=='-'||a[i]=='!'||a[i]=='?') beg=0; else if(beg==0) { if((a[i]>'Z'||a[i]<'A')&&a[i]!=' ') wrong++; if(a[i]!=' ') beg=1; } else if(a[i]<='Z'&&a[i]>='A') { if(a[i-1]!=' ') wrong++; } } printf("\n%d",wrong); } I don't know why its wrong. I'm wrong in test#3 I'm check many inputs but I think answers is true. Please suggest me something..TT |
|
|