1、noip2008_11VARi,a,b,c,d:integer;f:array0.3 of integer;BEGIN for i:=0 to 3 do read(fi);a:=f0+f1+f2+f3;a:=a div f0;b:=f0+f2+f3;b:=b div a;c:=(b*f1+a)div f2;d:=f(b div c)mod 4;if(f(a+b+c+d)mod 4f2)then begin a:=a+b;writeln(a);end else begin c:=c+d;writeln(c);end;END.输入:输入:9 19 29 39输出:输出:_noip2008_22pr
2、ocedure foo(a,b,c:integer);begin if ab then foo(c,a,b)else writeln(a,b,c);end;var a,b,c:integer;begin read(a,b,c);foo(a,b,c);end.输入:输入:3 1 2输出:输出:_noip2009_11.var a,b:integer;function work(a,b:integer):integer;begin if a mod b 0 then work:=work(b,a mod b)else work:=b;end;begin read(a,b);writeln(work
3、(a,b);end.输入:20 12输出:_Noip2009_22.var a,b:array0.2 of integer;i,j,tmp:integer;begin for i:=0 to 2 do read(bi);for i:=0 to 2 do begin ai:=0;for j:=0 to i do begin inc(ai,bj);inc(bai mod 3,aj);end;end;tmp:=1;for i:=0 to 2 do begin ai:=ai mod 10;bi:=bi mod 10;tmp:=tmp*(ai+bi)end;writeln(tmp);end.输入:2 3
4、 5输出:_Noip2009_33.const c=2009;var n,p,s,i,j,t:integer;begin read(n,p);s:=0;t:=1;for i:=1 to n do begin t:=t*p mod c;for j:=1 to i do s:=(s+t)mod c;end;writeln(s);end.输入:输入:11 2输出:输出:_Noip2010_11.var a1,a2,a3,x:integer;procedure swap(var a,b:integer);var t:integer;begin t:=a;a:=b;b:=t;end;begin read
5、ln(a1,a2,a3);if a1a2 then swap(a1,a2);if a2a3 then swap(a2,a3);if a1a2 then swap(a1,a2);readln(x);if xa2 then if xa1 then writeln(x,a1,a3,a3)else writeln(a1,x,a2,a3)else if xa3 then writeln(a1,a2,x,a3)else writeln(a1,a2,a3,x)end.输入 91 2 20 77 输出:_Noip2010_22 var n:integer;procedure f2(x,y:integer);f
6、orward;procedure f1(x,y:integer);Begin if x n then f2(y,x+y);end;procedure f2(x,y:integer);begin write(x,);f1(y,x+y);end;begin readln(n);f1(0,1);end 输入:30 输出:_Noip2011_11ConstSIZE=100;varn,i,sum,x:integer;a:array1.SIZE of integer;beginreadln(n);fillchar(a,sizeof(a),0);for i:=1 to n dobeginread(x);in
7、c(ax);end;i:=0;sum:=0;while sum (n div 2+1)dobegininc(i);sum:=sum+ai;end;writeln(i);end输入:114 5 6 6 4 3 3 2 3 2 1输出:Noip2011_2varn:integer;procedure f2(x,y:integer);forward;procedure f1(x,y:integer);beginif x n thenf2(y,x+y);end;procedure f2(x,y:integer);beginwrite(x,);f1(y,x+y);end;beginreadln(n);f1(0,1);end输入:30输出:_谢谢观赏WPS OfficeMake Presentation much more fun