|
|
вернуться в форумWhat's wrong with my program????? #include<stdio.h> char status='0',q; /* status : 0 new sentence
1 new word
2 in word*/ int counter=0,mistake=0; void main() { while((!feof(stdin))&&(++counter<=80)) { scanf("%c",&q); if((q=='!')||(q=='.')||(q=='?'))status='0'; else if((q==' ')/*||(q=='-')||(q==',')||(q==';')||(q==':')*/){if (status!='0')status='1';} else if(((int)q>=97)&&((int)q<=122)) // Small { if(status=='0')mistake++; status='2'; } else if(((int)q>=65)&&((int)q<=90)) // Capital { if(status=='2')mistake++; else status='2'; } else if(q=='\n')counter--; } printf("%d\n",mistake); } |
|
|