/ SB域 /

记录详情

Accepted

/usr/bin/ld.bfd: warning: /out/link.res contains output sections; did you forget -T?
# 状态 耗时 内存占用
#1 Accepted 1ms 256.0 KiB
#2 Accepted 1ms 256.0 KiB
#3 Accepted 1ms 256.0 KiB
#4 Accepted 1ms 256.0 KiB
#5 Accepted 1ms 256.0 KiB
#6 Accepted 1ms 256.0 KiB
#7 Accepted 1ms 256.0 KiB
#8 Accepted 1ms 256.0 KiB
#9 Accepted 0ms 256.0 KiB
#10 Accepted 1ms 256.0 KiB

代码

var data:string;
    y:array[1..12]of integer;
    numday,numday1,yy,mm,dd,day1,fullday:longint;
procedure print(yy,mm,dd:longint);
var  i:longint;
     sy,sm,sd:string;
begin
 str(yy,sy);
 str(mm,sm);
 str(dd,sd);
 for i:=1 to 4-length(sy) do write(0);
 write(sy+'-');
 for i:=1 to 2-length(sm) do write(0);
 write(sm+'-');
 for i:=1 to 2-length(sd) do write(0);
 writeln(sd);
end;
function f(year:longint):boolean;
begin
 if ((year mod 4=0) and(year mod 100<>0))or(year mod 400=0)then exit(true);
 exit(false);
end;
begin
 y[1]:=31;y[2]:=28;y[3]:=31;y[4]:=30;y[5]:=31;
 y[6]:=30;y[7]:=31;y[8]:=31;y[9]:=30;y[10]:=31;
 y[11]:=30;y[12]:=31;
 readln(data);
 val(copy(data,1,4),yy);
 val(copy(data,6,2),mm);
 val(copy(data,9,2),dd);
 readln(numday);
 readln(numday1);
 readln(day1);
 while  not((numday=numday1)and(dd=day1)) do begin
  if numday=1 then numday:=7 else dec(numday);
  if dd=1 then begin
    if mm=1 then begin mm:=12; dec(yy); end else dec(mm);
    if f(yy) then begin y[2]:=29;
      fullday:=y[mm];
      dd:=fullday;
      y[2]:=28;
      end
    else begin
     fullday:=y[mm];
     dd:=fullday;
    end;
  end else dec(dd);
//  writeln(yy,' ',mm,' ',dd,' ',numday);
 end;
 print(yy,mm,dd);
 close(input);
 close(output);
end.

信息

递交者
类型
递交
题目
小Q的日历
题目数据
下载
语言
Pascal
递交时间
2017-08-22 14:39:58
评测时间
2017-08-22 14:39:58
评测机
分数
100
总耗时
13ms
峰值内存
256.0 KiB