ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 2023. Donald is a postman

тест №6 в чем проблема? pascal
Posted by Alectros 17 Nov 2016 23:35
var str: string;
i,kol,n,pol: integer;
begin
readln(n);
pol:=1;
kol:=0;
for i:=1 to n do
begin
readln(str);
if (str='Alice')or(str='Ariel')or(str='Aurora')or(str='Phil')or(str='Peter')or(str='Olaf')or(str='Phoebus')or(str='Ralph')or(str='Robin') then
begin
kol:=kol+abs(pol-1);pol:=1;
end
else
if (str='Bembe')or(str='Belle')or(str='Bolt')or(str='Mulan')or(str='Mowgli')or(str='Mickey')or(str='Silver')or(str='Simba')or(str='Stitch') then
begin
kol:=kol+abs(pol-2);pol:=2;
end
else
if (str='Dumbo')or(str='Genie')or(str='Jiminy')or(str='Kuzko')or(str='Kida')or(str='Kenai')or(str='Tarzan')or(str='Tiana')or(str='Winnie') then
begin
kol:=kol+abs(pol-3);pol:=3;
end;
end;
write(kol);
end.

Edited by author 17.11.2016 23:36

Edited by author 17.11.2016 23:36
Re: тест №6 в чем проблема? pascal
Posted by ToadMonster 18 Nov 2016 15:33
Check names carefully.
Re: тест №6 в чем проблема? pascal
Posted by Alectros 18 Nov 2016 19:55
а все моя ошибка написал "Bembe" вместо "Bambi"
Re: тест №6 в чем проблема? pascal
Posted by Raheleh 5 Jul 2019 20:53
For me it was a type mistake in "Mickey"