永发信息网

问我的程序哪里错了?

答案:2  悬赏:80  手机版
解决时间 2021-04-30 19:27
  • 提问者网友:放下
  • 2021-04-29 22:29
USER: yi fang [fy111111] TASK: friday LANG: PASCAL Compiling... Compile: OK Executing... Test 1: TEST OK [0.000 secs, 208 KB] Test 2: TEST OK [0.000 secs, 208 KB] Test 3: TEST OK [0.000 secs, 208 KB]
> Run 4: Execution error: Your program did not produce an answer that was judged as correct. The program stopped at 0.000 seconds; it used 208 KB of memory. Here are the respective outputs: ----- our output --------- 23_21_22_22_24_21_23 ---- your output --------- 22_22_21_23_22_22_24 -------------------------- ------ Data for Run 4 ------ 13 ----------------------------
Test 4: BADCHECK 0.000 (0.000 secs, 208 KB) {
ID:fy111111
PROG:friday
LANG:PASCAL
}
var
        s,a:array[0..12]of longint;
        n,m,i,j,k:longint;
procedure aa(q:longint);
begin
if q<>2 then
        case q of
        1,3,5,7,8,10,12:a[q]:=31;
        4,6,9,11:a[q]:=30;
        end
        else if (1900+i) mod 400=0 then a[2]:=29
             else if (1900+i) mod 100=0 then a[2]:=28
             else if (1900+i) mod 4=0  then a[2]:=29;
end;
begin
        assign(input,'friday.in');reset(input);
        assign(output,'friday.out');rewrite(output);
        readln(n);
         m:=13;i:=0;
         k:=m mod 7;
                inc(s[k]);
        repeat
                for j:=1 to 11 do
                begin
                aa(j);
                m:=m+a[j];
                k:=m mod 7;
                inc(s[k]);
                end;
                if i<>n-1 then
                begin
                aa(12);
                m:=m+a[12];
                k:=m mod 7;
                inc(s[k]);
                end;
                inc(i);
                until i=n;
        write(s[6],' ');
        for i:=0 to 4 do
        write(s[i],' ');
        write(s[5]);
        writeln;
        close(input);
        close(output);
end.
最佳答案
  • 五星知识达人网友:西岸风
  • 2021-04-29 23:33
请你把题目带上。要中文的题目。应该就会有人来帮你看看错哪了。
全部回答
  • 1楼网友:几近狂妄
  • 2021-04-30 00:21
你的看上去好麻烦啊,我也错这道(死都通不过),我想你可能是把这个月的当下个月加了
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯