为什么30分 摊手

P2010 [NOIP2016 普及组] 回文日期

赏味期限 @ 2017-03-26 16:07:14

program project1;
var
  ans,s1,i,s2,t,y,m,d,date:integer;
function f(x,m,d:integer):boolean;
begin
     f:=true;
     if (m>12)or(m<1)then f:=false;
     if (d>31)or(d<1)then f:=false;
     case m of
      4,6,9,11:if d=31 then f:=false;
      2: if d=30 then f:=false;
     end;
end;
begin
  readln(s1);
  readln(s2);
  ans:=0;
  t:=(s2 div 10000)-(s1 div 10000)+1;
  for i:=1 to t do
   begin
     y:=s1 div 10000+i-1;
     m:=(y mod 10)*10+(y div 10 mod 10);
     d:=(y div 100 mod 10)*10+(y div 1000);
     date:=y*10000+m*100+d;
     if (date>=s1) and(date<=s2) then
      if f(y,m,d)=true then inc(ans);
   end;
  writeln(ans);
  readln;
  readln;
end.

by orange0915 @ 2017-04-29 14:34:32

这就奇怪了


begin
 readln(q);
 readln(r);
 u:=0;
 for s:= q to r do
  begin
   t:=s div 10000;
   a:=s mod 10000;
   if t=a then u:=u+1;
  end;
 write(u);
end.```

by 出言不逊王子 @ 2020-06-05 21:15:38

考古,好臭啊


by 樱初音斗橡皮 @ 2020-06-05 22:55:28

我谔谔,,,事臭臭人,,,臭臭人野蛮,,,


by A_Problem_Solver @ 2023-08-01 18:02:00

___9810考古


|