资源描述:
《测试报告 - read》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、测试报告360606222陈海赞1.测试程序及测试结果①测试程序:constz=0;varhead,foot,cock,rabbit,n:integer;beginn:=z;read(head,foot);cock:=1;cock:=cock+1;forcock:=1downto1dobeginwriteln(0)end;cock:=1;whilecock<=headdobeginrabbit:=head-cock;ifcock*2+rabbit*4=footthenbeginwrite(cock,rabbit);n:=n+1end;cock:=coc
2、k+1;end;ifn=0thenwrite(0,0)end.测试结果:②测试程序:varday,y,m,d:integer;beginy:=1;m:=0;d:=0;day:=(1461*y)div4+(153*m+2)div5+d;end.测试结果:③测试程序:consta=45;b=27;varx,y,g,m:integer;boo:boolean;procedureswap;vartemp:integer;begintemp:=x;x:=y;y:=tempend;functionfunc(vara:integer;b:boolean):integ
3、er;begina:=100;a:=100;end;proceduremodd;x:=x-xdivy*y;beginx:=a;y:=b;modd;whilex<>0dobeginswap;moddend;g:=y;m:=a*bdivg;writeln(g,m);write(100*200);end.测试结果:④测试程序vari,j:integer;beginfori:=1to9dobeginforj:=1to9dobeginwrite(j);write(i);write(i*j);end;writeln;end;readln;end.测试结果:⑤测试程
4、序:vara:integer;beginwhilea<0dobeginread(a);write(a)end;end.测试结果:⑥测试程序:varday,y,m,d:integer;beginy:=1;y:=y/0;m:=0;d:=0;day:=(1461*y)div4+(153*m+2)div5+d;end.测试结果:⑦测试程序:programcpstud1;varday,y,m,d:integer;beginy:=1;y:=y/0;m:=0;d:=0;day:=(1461*y)div4+(153*m+2)div5+d;end.测试结果:⑧测试程序:
5、varx,y,m,n:integer;varpf:boolean;procedureprime;vari:boolean;varf:integer;proceduremod;x:=x-x/y*y;beginf:=true;i:=3;whilei=2dobeginwrite(2);ifn=2thenpf:=
6、true;m:=3;whilem<=ndobegincallprime;m:=m+2end;read(n)end;ifpf=falsethenwrite(0)end.测试结果:⑨测试程序:varoil,help:char;kg,total:real;beginwrite('Entertheamountinkilograms(kg):');readln(kg);write('Entertypeofthegasonline(a,b,c):');readln(oil);write('Entertypeforservice(f,m,e):');readln(h
7、elp);caseoilof'a':total:=1.50*kg;'b':total:=1.35*kg;'c':total:=1.18*kg;elsewriteln('InputError!');end;casehelpof'f':;'m':total:=total*(1-0.05);'e':total:=total*(1-0.10);elsewriteln('InputError!');end;writeln;writeln('Totalis',total:10:2);end.测试结果:⑩测试程序:varday,y,m,d:integer;begin
8、y:=1m:=0;d:=0;day:=(1461*y)div4+(153*m+2)div5+d