1.
program program1;
Var
a,b,c,d,e:integer;
begin
a:=79 ; b:=34; c:=57;d:=0 ; e:=-1;
if (a<c) or (b>c) then d:=d+e
else if (d+10<e) then d:=e+10
else d:=e-a;
writeln(d);
end.
输出:-80
2.
program program2;
var
i,j:integer;
str1,str2:string;
begin
str1:='pig-is-stupid';
str2:='clever';
str1[1]:='d'; str1[2]:='o';
i:=8;
for j:=1 to 6 do begin
str1[i]:=str2[j];inc(i);
end;
writeln(str1);
end.
输出:dog-is-clever
3.
program program3;
var
u:array[0..3] of integer;
a,b,c,x,y,z:integer;
begin
read(u[0],u[1],u[2],u[3]);
a:=u[0]+u[1]+u[2]+u[3]-5;
b:=u[0]*(u[1]-u[2] div u[3]+8);
c:=u[0]*u[1] div u[2] * u[3];
x:=(a+b+2)*3-u[(c+3) mod 4];
y:=(c*100-13) div a div (u[b mod 3]*5);
if ((x+y) mod 2=0) then z:=(a+b+c+x+y) div 2;
z:=(a+b+c-x-y)*2;
writeln(x+y-z);
read(a);
end.
输出:263
4.
program program4 ;
var c:array[1..2] of string[200];
s:array[1..10] of integer;
m,n,i:integer ;
procedure numara;
var cod:boolean;
i,j,nr:integer;
begin
for j:=1 to n do begin
nr:=0;cod:=true;
for i:=1 to m do
if c[i,j]='1' then begin
if not cod then begin
cod:=true;inc(s[nr]);nr:=0;
end
end
else begin
if cod then begin
nr:=1;cod:=false ;
end
else inc(nr);
end;
if not cod then inc(s[nr]);
end;
end;
begin
readln(m,n);
for i:=1 to m do readln(c[i]);
numara;
for i:=1 to m do
if s[i] <>0 then write(i,' ',s[i],' ');
read(i);
end.
输出:1 12588 2 12337 3 12339