ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1038. Spell Checker

Why WA#2?????????
Posted by Alexander Gyorev 25 Apr 2008 15:32
#include<iostream>
using namespace std;
char c, last, last_zn;
int br;
int main()
{
    cin.get(last);
    if(last>='a'&&last<='z') br++;
    while(cin.get(c))
    {
      if(((last_zn=='.')||(last_zn=='!')||(last_zn=='?'))&&((c>='A')&&(c<='Z'))) last_zn=' ';
      if(((last_zn=='.')||(last_zn=='!')||(last_zn=='?'))&&((c>='a')&&(c<='z'))) { /*cout<<c<<endl;*/ br++; last_zn=' '; }
      if(((last>='a'&&last<='z')||(last>='A'&&last<='Z'))&&(c>='A'&&c<='Z')) { /*cout<<c<<endl;*/ br++; }
      last=c;
      if((c=='.')||(c=='?')||(c=='!')) last_zn=c;
    }
    cout<<br<<endl;
    return 0;
}


I tried all the tests here and none of them gave me WA. Can you tell me where is my mistake???