Submission ID | Problem | Status | Score | Time | Memory | Code / Answer files | User | Submit time |
---|---|---|---|---|---|---|---|---|
#16999 | #53. Zodiac Signs | Compile Error | 0 | 0 ms | 0 K | Pascal / 2.5 K | HKSC2023-093 | 2023-07-08 16:53:39 |
var
n, aries, taurus, gemini, cancer, leo, virgo, libra, scorpio, sagittarius, capricorn, aquarius, pisces: Integer;
begin
readln(n);
aries := 0; taurus := 0; gemini := 0; cancer := 0; leo := 0; virgo := 0; libra := 0; scorpio := 0;
sagittarius := 0; capricorn := 0; aquarius := 0; pisces := 0;
for i:=1 to n do
begin
readln(s);
case s[1..3] of
'Jan': begin if (s[5..6] >= '20') and (s[5..6] <= '31') then aquarius := aquarius + 1
else capricorn := capricorn + 1 end;
'Feb': begin if (s[5..6] >= '19') and (s[5..6] <= '28') then pisces := pisces + 1
else aquarius := aquarius + 1 end;
'Mar': begin if (s[5..6] >= '21') and (s[5..6] <= '31') then aries := aries + 1 end;
'Apr': begin if (s[5..6] >= '01') and (s[5..6] <= '19') then aries := aries + 1
else taurus := taurus + 1 end;
'May': begin if (s[5..6] >= '01') and (s[5..6] <= '20') then taurus := taurus + 1
else gemini := gemini + 1 end;
'Jun': begin if (s[5..6] >= '21') and (s[5..6] <= '30') then gemini := gemini + 1
else cancer := cancer + 1 end;
'Jul': begin if (s[5..6] >= '01') and (s[5..6] <= '22') then cancer := cancer + 1
else leo := leo + 1 end;
'Aug': begin if (s[5..6] >= '23') and (s[5..6] <= '31') then leo := leo + 1
else virgo := virgo + 1 end;
'Sep': begin if (s[5..6] >= '01') and (s[5..6] <= '22') then virgo := virgo + 1
else libra := libra + 1 end;
'Oct': begin if (s[5..6] >= '23') and (s[5..6] <= '31') then libra := libra + 1
else scorpio := scorpio + 1 end;
'Nov': begin if (s[5..6] >= '01') and (s[5..6] <= '21') then scorpio := scorpio + 1
else sagittarius := sagittarius + 1 end;
'Dec': begin if (s[5..6] >= '22') and (s[5..6] <= '31') then sagittarius := sagittarius + 1
else capricorn := capricorn + 1 end;
end;
end;
writeln('Aries: ',aries);
writeln('Taurus: ',taurus);
writeln('Gemini: ',gemini);
writeln('Cancer: ',cancer);
writeln('Leo: ',leo);
writeln('Virgo: ',virgo);
writeln('Libra: ',libra);
writeln('Scorpio: ',scorpio);
writeln('Sagittarius: ',sagittarius);
writeln('Capricorn: ',capricorn);
writeln('Aquarius: ',aquarius);
writeln('Pisces: ',pisces);
end.
Compile log
Free Pascal Compiler version 3.0.4+dfsg-23 [2019/11/25] for x86_64
Copyright (c) 1993-2017 by Florian Klaempfl and others
Target OS: Linux for x86-64
Compiling a.pas
a.pas(8,7) Error: Identifier not found "i"
a.pas(8,7) Error: Ordinal expression expected
a.pas(8,7) Error: Illegal counter variable
a.pas(10,12) Error: Identifier not found "s"
a.pas(11,10) Error: Identifier not found "s"
a.pas(11,13) Fatal: Syntax error, "]" expected but ".." found
Fatal: Compilation aborted
Error: /usr/bin/ppcx64 returned an error exitcode