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

Обсуждение задачи 1038. Проверка орфографии

Not a complicated question+++++++
Послано Виктор Крупко 29 апр 2005 02:18
On what letters there is a mistake?
But there are two BIG mistakes in this one!
I think on "I" and "G".
I am right?
Yes (-)
Послано Dmitry 'Diman_YES' Kovalioff 29 апр 2005 08:36
Thanks///
Послано Виктор Крупко 29 апр 2005 09:03
why wrong answer 2
Послано Виктор Крупко 29 апр 2005 09:56
program de;
const min = ['a'..'z'];
      max = ['A'..'Z'];
      pyn = ['.','!','?'];
    var
    a:array[1..100] of string;
    q1,q2:boolean;
    c:char;
    i,n,mist,j:integer;
    u:text;
begin
 {  assign(u,'c:\test2.txt');
   reset(u);}
   while not eof do
   begin
      inc(n);
      readln(a[n]);
   end;
   for i:=1 to n do
   begin
   q1:=true;
   q2:=false;
   for j:=1 to length(a[i]) do
    begin
     if not (a[i][j] in min+max) then   q2:=false;
     if q1 and (a[i][j] in min) then    inc(mist);
     if q2 and (a[i][j] in max) then    inc(mist);
     q1:=false;
     if (a[i][j] in max) then q2:=true;
     if a[i][j] in pyn then
     begin
      if j<n then
        begin
         inc(j);
         q1:=true;
        end
      else q1:=true;
     end;
    end;
   end;
   writeln(mist);
end.
Re: why wrong answer 2
Послано Kit 29 апр 2005 15:04
This sentence iz correkt! -It Has,No mista;.Kes et oll.
But there are two BIG mistakes in this one. and here is one more.
Re: why wrong answer 2
Послано Виктор Крупко 29 апр 2005 16:07
Thanks for the help, but again too.
I can something I do not understand
Re: why wrong answer 2
Послано Виктор Крупко 29 апр 2005 20:25
program de;
const min = ['a'..'z'];
      max = ['A'..'Z'];
      pyn = ['.','!','?'];
    var
    a:array[1..100] of string;
    q1,q2:boolean;
    c:char;
    i,n,mist,j,z:integer;
    u:text;
begin
 {  assign(u,'c:\test1.txt');
   reset(u);}
   while (not eof)  do
   begin
      inc(n);
      readln(a[n]);
   end;
   for i:=1 to n do
   begin
   z:=1;
   q2:=false;
   for j:=1 to length(a[i]) do
    begin
     inc(z);
     if not (a[i][j] in min+max) or (z=1) then   q2:=false;
     if (a[i][j] in min) and (z=2) and ((a[i][j-1]=' ') or (j-1=0)) then inc(mist);
     if q2 and (a[i][j] in max)  then inc(mist);
     if (a[i][j] in max) and (z<>1) then q2:=true;
     if a[i][j] in pyn then z:=0;
    end;
   end;
   writeln(mist);
end.
Re: why wrong answer 2
Послано Kit 30 апр 2005 14:53
This sentence iz correkt! -It Has,No mista;.Kes et oll.
But there are two bIG mistakes in this one.and here is one more.


Your answer is 1, instead of 3. If you wish, I can send to you my code.

Edited by author 30.04.2005 14:53
Re: why wrong answer 2
Послано Dilyan 29 июн 2005 16:38
I think that you have WA2 because you read with STRING.
All the simbols can be on one line and there may be 10 000 simbols. The string's capacity is less than 256.

Edited by author 29.06.2005 16:38
Re: why wrong answer 2
Послано Gleb Grenkin 15 авг 2005 14:03
To Dilyan:

I think that Delphi or Free Pascal is used on this server.
In Delphi you can use string - it's long strings (up to 2 GB).
In Free Pascal you can use AnsiString.