Help me to find a mistake please!

This is my source

[code deleted]

What is wrong?

I can't find any mistakes but i always get WA!

Please Help me to find my mistake!

Thank you!

*Edited by author 03.07.2008 00:29*

*Edited by author 05.07.2008 20:59*

Re: Help me to find a mistake please!

there are many notes which may help you make your code CLEANer

and finding your mistake:

1. use scanf("%d\n",&n) instead of cin>>n (because there cin will not read the '\n' and it will be read by getline)

2.This part may be shortened

for(j=0;j<sz;j++)

{

if(j==0&&s[j]=='L')br++;

else

if(j==0&&s[j]=='M')br1++;

else

if(j==0&&s[j]=='E')br2++;

}

INSTEAD:

if(s[j]=='L')br++;

else if(s[j]==....

3. and do not bother yourself with finding the maximum number in this way. you can make it shorter

Re: Help me to find a mistake please!

I understood my mistakes and they ware very silly.

Thank you Seyyed for helping me ;)

*Edited by author 30.08.2008 20:34*