标题:谁能帮我看看这段tp那里出错了
取消只看楼主
董翔宇
Rank: 1
来 自:江苏
等 级:新手上路
帖 子:3
专家分:0
注 册:2008-6-7
 问题点数:0 回复次数:2 
谁能帮我看看这段tp那里出错了
program work06;
var n,y,r:integer;
begin
write('please input the year');readln(n);
write('please input the month');readln(y);
case r of
  1,3,5,7,8,10,12: r:=31;
  4,6,9,11: r:=30;
  2:begin
     if (n mod 4=0) then begin
       if (n mod 100=0)then
         begin
           if (n mod 400=0)then
              begin
                r:=31;
              end
           else
              begin
                r:=30;
              end;
         end
       else
         begin
           r:=31;
         end;
      end
     else begin
           r:=30;
          end;
   else writeln('WRONG!');
  end;
writeln('there are',r,'days in this month');
readln;
end.
搜索更多相关主题的帖子: begin mod end input else 
2008-06-07 21:14
董翔宇
Rank: 1
来 自:江苏
等 级:新手上路
帖 子:3
专家分:0
注 册:2008-6-7
得分:0 
拜托
2008-06-08 13:46
董翔宇
Rank: 1
来 自:江苏
等 级:新手上路
帖 子:3
专家分:0
注 册:2008-6-7
得分:0 
program work06;
var n,y,r:integer;
begin
write('please input the year');readln(n);
write('please input the month');readln(y);
case r of
  1,3,5,7,8,10,12: r:=31;
  4,6,9,11: r:=30;
  2:begin
     if (n mod 4=0) then begin
       if (n mod 100=0)then
         begin
           if (n mod 400=0)then
              begin
                r:=29;
              end
           else
              begin
                r:=28;
              end;
         end
       else
         begin
           r:=29;
         end;
      end
     else begin
           r:=28;
          end;
   else writeln('WRONG!');
  end;
writeln('there are',r,'days in this month');
readln;
end.
改过了,可是还是提示“error in statement”
2008-06-18 16:45



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-218156-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.045129 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved