谁帮我用PASCAL做一个计算天数的程序?

来源:百度知道 编辑:UC知道 时间:2024/05/22 12:27:39
就是输入开始年月日至结束年月日,计算出期间经过的天数。要考虑闰年。如果回答得好就有追加分。
时间范围从-10000年到10000年,否则错误。
派克笔小新:有错误啊!第20行应是readln(m,n,p); 才对!!!还有的地方漏了分号~~~改了之后还有一个错误。最好还加上说明!还有一个问题:fillchar是什么意思?先谢谢拉!改好了给你50分哦!!!

program xxx;
var
i,x,y,z,m,n,p:integer;
a:array[-10000..10000]of integer;
w:longint;
b:array[1..12]of integer;
begin
fillchar(a,sizeof(a),0); {数组清零}
for i:=-10000 to 10000 do
if ((i mod 100<>0)and(i mod 4=0))or(i mod 400=0) then a[i]:=1;
for i:=1 to 7 do
if i mod 2<>0 then b[i]:=31 else b[i]:=30;
for i:=8 to 12 do
if i mod 2=0 then b[i]:=31 else b[i]:=30;
readln(x,y,z);
b[2]:=28+a[x];
w:=0;
for i:=y+1 to 12 do w:=w+b[i];
w:=w+b[y]-z+1;
readln(m,n,p);
b[2]:=28+a[m];
for i:=n-1 downto 1 do w:=w+b[i];
w:=w+z;
for i:=x+1 to m-1 do w:=w+365+a[i];
writeln(w);
readln;
end.
多多加分哦!
就是这样了,MS米问题了撒

你给个范围呀!最早多少年 最迟多少年?
还有公元前呀!太麻烦,你弄个两百分看看有没有人帮你遍吧!

fillchar,fill:充满,char:字符。就是把字符数组的值变成一样的字符或把数值数组的值都变成0或-1.
Program E0708251;
Const
outfire = 'calander.out';
Var
days, yy