1. 输入两个整数,按由大到小的顺序输出. (1-1) var a,b:integer; begin readln(a,b); if a=b then write(a,b) else write(b,a) end. (1-2) var a,b:integer; begin readln(a,b); if ab then write(a:5,b:5) else write(b:5,a:5); if a=b then write( a=b ); end. 2. 输入三个整数,按由大到小的顺序输出. var a,b,c:integer; max, begin readln(a,b,c); if ab then begin max:=a; min:=b end else begin min:=a; max:=b end; if cmax then begin max:=c end; if cmin then begin min:=c end; writeln() end. 3. 求和s=1+2+3+4+...10 var s,x:integer; begin s:=0; for x:=1 to 10 do s:=x+s; writeln(s); end. 4. 求乘积 s=1*2*3*4*...10 var s:real; x:integer; begin s:=1; for x:=1 to 10 do s:=s*x; writeln(s:9:0); end.v 5. 计算s=1-12+13-14+15-16+17-18+19-110的值 var i:integer; s:real; begin i:=1;s:=0; for i:=1 to 10 do if (i mod 2)0 then s:=s+1i else s:=s-1i; (此处很好!) writeln(s:9:4) end. 6. 有一分数序列:21,32,53,85,138,2113...求出这个数列的前20项之和. var i,t,fz, s:real; begin s:=0;fz:=2;fm:=1; for i:=1 to 20 do begin s:=s+fzfm; t:=fz+fm; fm:=fz; fz:=t; end; writeln(s:8:2); end. 7. 输入10个数字,求其中最大的那个数字. var a:array[1..10] of integer; i, begin for i:=1 to 10 do readln(a[i]); max:=a[1]; for i:=2 to 10 do if a[i]max then max:=a[i];(逐个比) write( max= ,max); end. 8. 输入10个数字,求其中次大的那个数字. var a:array[1..10] of integer; i,max1, begin for i:=1 to 10 do readln(a[i]); if a[1]a[2] then begin max1:=a[i];max2:=a[2];end else begin max1:=a[2];max2:=a[1];end; for i:=3 to 10 do if a[i]max1 then begin max2:=max1;max1:=a[i]end;(max1用来比,max2接替max1) write( max2= ,max2); end. 9. 求和s=1+2+4+7+11...n(其中n是小于100的最大整数)(?) var s,a,i:integer; begin s:=0;a:=1;i:=1; while a100 do begin i:=i+1; s:=a+s; s:=s+a; a:=a+i; a:=a+i-1; i:=i+1 end; writeln(s); end. 10. 求和s=1+2+4+8+16+32+...n(n是小于1000的最大整数) var s,i:integer; begin s:=0;i:=1; while (i1000) do begin s:=s+i; i:=i*2; end; writeln(s) end. 11. 有一对兔子,从出生后第3个月起每个月都生一对兔子,小兔子长到第三个月后每个月又生一对兔子,假如兔子都不死,问每个月的兔子总数为多少? var a,b,c,i,n:integer; s:real; begin readln(n); a:=1;b:=0;s:=a+b; for i:=1 to n-2 do begin c:=a+b; s:=s+c; a:=b; b:=c; end; writeln(s:9:4); end.