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

Обсуждение задачи 1242. Оборотень

for anyone who wants to solve this problem:
Послано Koala 10 сен 2003 07:51
Maybe the format of input is not: number_number. ("_"represent a
space) So please read it one character by another.
And i'll share you the procedure of reading datas.
Послано Koala 10 сен 2003 07:53
  readln(n);
  fillchar(a,sizeof(a),0);
  fillchar(b,sizeof(b),0);
  while true do
  begin
    read(ch); while ch=' ' do read(ch);
    if ch='B' then
    begin
      readln;
      break;
    end;
    x:=0;
    while ch<>' ' do
    begin
      x:=x*10+ord(ch)-ord('0');
      read(ch);
    end;
    readln(y);
    insert(a[x],y); insert(b[y],x);
  end;
Re: And i'll share you the procedure of reading datas.
Послано GodZilla 15 сен 2003 20:07
Maybe you are right !
I change my reading procedure (not like you) and I
got AC
Thank you!I got AC.
Послано Y.Y.M. 14 июн 2004 19:40
At first,I used String to read data.
But I WA on text#1.
Finally,I realized that the input formal is like this:
number_number_.There may be some '_' after the second number.
I improve my program and got AC.
That's right. The second line in sample input #2 has a space at the end of line. But(+)
Послано Maigo Akisame (maigoakisame@yahoo.com.cn) 14 окт 2004 04:48
But you don't need to read character by character. You read a string, then delete all the spaces at its end, and you'll get AC.