ENG  RUSTimus Online Judge
Online Judge
Задачи
Авторы
Соревнования
О системе
Часто задаваемые вопросы
Новости сайта
Форум
Ссылки
Архив задач
Отправить на проверку
Состояние проверки
Руководство
Регистрация
Исправить данные
Рейтинг авторов
Текущее соревнование
Расписание
Прошедшие соревнования
Правила
вернуться в форум

Обсуждение задачи 1585. Пингвины

Help me to find a mistake please!
Послано RoskaTa 3 июл 2008 00:28
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!
Послано Seyyed Mehran Kholdi 4 июл 2008 03:19
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!
Послано RoskaTa 5 июл 2008 20:58
I understood my mistakes and they ware very silly.
Thank you Seyyed for helping me ;)

Edited by author 30.08.2008 20:34