Первая программа
const n=10;
var a,b:array[1..n] of integer;
i,j:integer;
begin
for i:=1 to n do readln(a[i]);
for i:=1 to n do
writeln('a[',i,']=',a[i]);
for i:=n downto 1 do begin
for j:=n-i+1 to n do begin
b[j]:=a[i];
break;
end;
writeln('b[',i,']=',b[i]);
end.
Вторая программа
var i,s1,s2:integer;
a:array[1..n] of integer;
for i:=1 to n do begin
if(a[i] mod 2 = 0) then
s1:=s1 + a[i];
if(a[i] mod 2 <> 0) then
s2:=s2 + a[i];
writeln('Разность равна: ',s1-s2);
Третья программа
if(i mod 2 = 0) then
if(i mod 2 <> 0) then
1.
program simple;
var a,b:integer;
writeln('daite a, b); readln(a,b);
writeln('x = ', b/a); readln;
2.
program day;
var h,hours,minutes:longint;
writeln('daite secundi'); readln(h);
hour:= h div 3600; minutes:=h mod 36000;
if (minutes > 60) or (minutes=60) then
hour:=hour+1;
minutes:=minutes-60;
writeln('It is 'hours' hours 'minutes' minutes');
readln;
3.
program summaChisla;
var s:string; i,sum: longint; c,cod:integer;
writeln('daite nomer); readln(s);
for i:=1 to length(s) do
val(s[i],c,cod); sum:=sum+c;
writeln('summa :',sum); readln;
Первая программа
const n=10;
var a,b:array[1..n] of integer;
i,j:integer;
begin
for i:=1 to n do readln(a[i]);
for i:=1 to n do
writeln('a[',i,']=',a[i]);
for i:=n downto 1 do begin
for j:=n-i+1 to n do begin
b[j]:=a[i];
break;
end;
end;
for i:=1 to n do
writeln('b[',i,']=',b[i]);
end.
Вторая программа
const n=10;
var i,s1,s2:integer;
a:array[1..n] of integer;
begin
for i:=1 to n do readln(a[i]);
for i:=1 to n do begin
if(a[i] mod 2 = 0) then
s1:=s1 + a[i];
if(a[i] mod 2 <> 0) then
s2:=s2 + a[i];
end;
writeln('Разность равна: ',s1-s2);
end.
Третья программа
const n=10;
var i,s1,s2:integer;
a:array[1..n] of integer;
begin
for i:=1 to n do readln(a[i]);
for i:=1 to n do begin
if(i mod 2 = 0) then
s1:=s1 + a[i];
if(i mod 2 <> 0) then
s2:=s2 + a[i];
end;
writeln('Разность равна: ',s1-s2);
end.
1.
program simple;
var a,b:integer;
begin
writeln('daite a, b); readln(a,b);
writeln('x = ', b/a); readln;
end;
2.
program day;
var h,hours,minutes:longint;
begin
writeln('daite secundi'); readln(h);
hour:= h div 3600; minutes:=h mod 36000;
if (minutes > 60) or (minutes=60) then
begin
hour:=hour+1;
minutes:=minutes-60;
end;
writeln('It is 'hours' hours 'minutes' minutes');
readln;
end;
3.
program summaChisla;
var s:string; i,sum: longint; c,cod:integer;
begin
writeln('daite nomer); readln(s);
for i:=1 to length(s) do
begin
val(s[i],c,cod); sum:=sum+c;
end;
writeln('summa :',sum); readln;
end;