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

Where is my mistake?
Posted by Volov_Forever 9 Apr 2009 21:54
Where is my mistake?
I have WA on test 2!!!

#include <iostream>
using namespace std;
int main ()
{
    char c;
    int i,n,br=0,b=0,l=1;
    while (cin>>c)
    {
        if (c=='!'||c=='?'||c=='.') l=1;
        else
        {
            if (c>='a'&&c<='z')
            if (l==1) br++;
            if (c>='A'&&c<='Z')
            if (l==0) br++;
            l=0;
        }
        if (c=='!'||c=='?'||c=='.')
        {
            if (br>0) b+=1;
            br=0;
        }
    }
    cout<<b<<endl;
    return 0;
}
Re: Where is my mistake?
Posted by romchik 15 Feb 2022 18:31
u cout "b"= 1

Edited by author 15.02.2022 18:32

Edited by author 15.02.2022 18:32