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

Обсуждение задачи 1197. Один в поле воин

Why WA1?
Послано Compile 6 мар 2005 14:28
I write program on C++

[code deleted]

I Submited it and WA1
After I submited program from this forum - AC
I tested programs, they give correct equal answers.
Why WA1? File of output of my program equal file of output forum's program.
Please, Help

Edited by moderator 08.08.2006 17:35
Re: Why WA1?
Послано Piratek-(akaDK) 6 авг 2006 23:28
Maybe you are don't correctly show answer

Edited by author 06.08.2006 23:32
Re: Why WA1?
Послано Ivankov Dmitry 7 авг 2006 13:24
int t1, t2;
scanf("%c%c%d", &t1, &t1, &t2);
It's wrong.
First of all %c means char, 1 byte. So you have not fully initialized t1, as it is not global variable and not initialized with zero.
And of course it's not good way to read input, what if there is an extra space in the end of a line? It's a text file after all ;)
And imho there is no reason to write (int argc, char* argv[])

Edited by author 07.08.2006 13:25