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

Обсуждение задачи 1226. йынтарбО кодяроп

Help! I got WA!
Послано Algorithmus_UA(algorithmus@univ.kiev.ua) 19 ноя 2002 13:57
var tmp:string;
    ch:char;
    j:integer;
begin
  tmp:='';
  while not eof do
  begin
    read(ch);
    if ch in ['A'..'z'] then
    begin
      tmp:=tmp+ch;
    end
    else
    begin
      for j:=length(tmp) downto 1 do write(tmp[j]);
      write(ch);
      tmp:='';
    end;
  end;
end.
See my solution on this webboard i got AC. Can you chack my anather programs on webboard
Послано I am david. Tabo. 19 ноя 2002 14:44
This will Help!
Послано JL Wang 19 ноя 2002 20:09
> var tmp:string;
>     ch:char;
>     j:integer;
> begin
>   tmp:='';
>   while not eof do
>   begin
>     read(ch);
>     if ch in ['A'..'z'] then
>     begin
>       tmp:=tmp+ch;
>     end
>     else
>     begin
>       for j:=length(tmp) downto 1 do write(tmp[j]);
>       write(ch);
>       tmp:='';
>     end;
>   end;
> end.



Hey, man! There's two mistakes in your program:
1.There's a lot of other symbol (not letter) between 'A'..'Z'
and 'a'..'z' in ASCII order. So do use set ['A'..'Z','a'..'z']
instead of set ['A'..'z'].
2.If the input ends by a letter not a symbol, your program will not
output the last word.

PS: If you still don't understand, see my solution below, it is an AC
one.
But i got AC
Послано I am david. Tabo. 19 ноя 2002 21:40
> > var tmp:string;
> >     ch:char;
> >     j:integer;
> > begin
> >   tmp:='';
> >   while not eof do
> >   begin
> >     read(ch);
> >     if ch in ['A'..'z'] then
> >     begin
> >       tmp:=tmp+ch;
> >     end
> >     else
> >     begin
> >       for j:=length(tmp) downto 1 do write(tmp[j]);
> >       write(ch);
> >       tmp:='';
> >     end;
> >   end;
> > end.
>
>
>
> Hey, man! There's two mistakes in your program:
> 1.There's a lot of other symbol (not letter) between 'A'..'Z'
> and 'a'..'z' in ASCII order. So do use set ['A'..'Z','a'..'z']
> instead of set ['A'..'z'].
> 2.If the input ends by a letter not a symbol, your program will not
> output the last word.
>
> PS: If you still don't understand, see my solution below, it is an
AC
> one.