#8782: 为什么错?


lswyf (吴豫飞)

學校 : 上海市娄山中学
編號 : 40608
來源 : [114.94.27.91]
最後登入時間 :
2014-09-07 11:05:08
a003. 兩光法師占卜術 | From: [114.94.27.91] | 發表日期 : 2014-04-24 20:24

var
  m,d:byte;
  s:real;
begin
  while not eof do begin
    readln(m,d);
    s:=(m*2+d)/100*3;
    if s=0 then writeln('普通')
           else if s=2 then writeln('大吉')
                       else if s=1 then writeln('吉');
  end;
end.
 
#8812: Re:为什么错?


lswei (魏子轩)

學校 : 上海市娄山中学
編號 : 40594
來源 : [101.231.75.150]
最後登入時間 :
2014-06-30 11:40:24
a003. 兩光法師占卜術 | From: [60.55.10.246] | 發表日期 : 2014-05-16 21:17

var
  m,d:byte;
  s:real;
begin
  while not eof do begin
    readln(m,d);
    s:=(m*2+d)/100*3;
    if s=0 then writeln('普通')
           else if s=2 then writeln('大吉')
                       else if s=1 then writeln('吉');
  end;
end.

因为题目中的“%3”不是百分之3,而是mod 3  
ZeroJudge Forum