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 1567. SMS-spam

where my mistake?
Posted by CaNoN 31 Dec 2012 01:52
var s: char;
i, sim: integer;
begin
sim:=0;
while not EOF do
begin
//for i:=1 to s do
begin
read (s);
if ((s='a') or (s='d') or (s='g')or(s='g') or (s='m')or (s='p') or (s='t') or (s='w')) then sim:= sim+1
else if ((s='b') or (s='e') or (s='h') or (s='k') or(s='n') or (s='q') or (s='u') or (s='x')) then sim:= sim+2
else if ((s='c') or (s='f') or (s='i') or (s='o') or (s='r') or (s='v') or (s='y')) then sim:= sim+3
else if ((s='s') or (s='z')) then sim:=sim+4
else if (s=' ') then sim:=sim+1
else if (s='.') then sim:= sim+1
else if (s=',') then sim:= sim+2
else if (s='!') then sim:= sim+3
end
end;
write (sim);
end.

Edited by author 31.12.2012 01:58