Первая:
var
x,y:integer;
begin
writeln('Vvedite x');
readln(x);
if x>0 then
y:=sqr(x)
else
y:=x+1;
writeln(y);
end.
Вторая
var
x:integer;
y:real;
begin
writeln('vvedite x');
readln(x);
if (x<0) and (x>=-1) then
y:=12.5*2
else
if x<-1 then
y:=x-1
else
y:=12*x;
writeln(y);
end.
Program n_1;
Var a, b, c, S, n: Integer;
Var q:Real;
Begin
Writeln('' Введите первое число'');
Readln(a) ;
Writeln('' Введите второе число'');
Readln(b) ;
Writeln('' Введите третье число'');
Readln(c) ;
S:=a+b+c;
n:=a*b*c;
q:=S/3;
Writeln(S) ;
Writeln(n) ;
Writeln(q) ;
end.
На обычном паскалеАБЦ
var a:array[1..24] of integer; k,i:integer;
begin
k:=0;
for i:=1 to 24 do read(a[i]);
for i:=1 to 24 do if (a[i]>0) and (a[i] mod 2=0) then k:=k+1;
write(k)
<span>end.</span>
1)
var a:array [1..10] of integer;
i,sum:integer;
begin
randomize;
sum:=0;
for i:=1 to 10 do
begin
a[i]:=random(100)-50;
write (a[i],' ');
if a[i] < 0 then sum:=sum+a[i];
end;
writeln;
writeln ('Summa: ',sum);
readln;
end.
2)
var a:array [1..10] of integer;
i,max,index:integer;
begin
for i:=1 to 10 do
begin
write ('A[',i,'] = ');
readln (a[i]);
end;
max:=a[1];
index:=1;
for i:=2 to 10 do
if a[i] > max then
begin
max:=a[i];
index:=i;
end;
writeln ('Max: ',max,'.Index: ',index);
readln;
end.
3)
var a:array [1..10] of integer;
max,min,i,temp:integer;
begin
randomize;
for i:=1 to 10 do
begin
a[i]:=random(50);
write (a[i],' ');
end;
writeln;
max:=1;
min:=1;
for i:=2 to 10 do
if a[i] > a[max] then max:=i else
if a[i] < min then min:=i;
writeln ('Max: ',a[max]);
writeln ('Min: ',a[min]);
temp:=a[min];
a[min]:=a[max];
a[max]:=temp;
for i:=1 to 10 do write (a[i],' ');
end.