1) var a:string; i, o: Integer; p: Real; begin readln(o); a := inttostr(o); for i := 1 to length(a) do p := p + strtoint(a[i]); if (sqr(o) = p*p*p) then writeln('true') else writeln('false'); end.
2) var a:string; i, o, p: Integer; begin readln(o); a := inttostr(o); for i := 1 to length(a) do p := p + strtoint(a[i]); if (p mod 3 = 0) then writeln('true') else writeln('false'); end.
3) var a, b, c: real; begin readln(a, b, c); if ((a = b) and (b = c)) then writeln('true') else writeln('false'); end.
Буду считать, что да, он самый востребованный тут =) 1) var a: array [0..9] of integer; i, o: integer; begin for i := 1 to 20 do begin if (i mod 4 = 0) then a[o] := i else if (i mod 4 = 2) then a[o] := -1 * i; if (i mod 4 mod 2 = 0) then o := o + 1; end; for i := 0 to 9 do writeln(a[i]); end.
2) var a: array [0..30] of integer; i, o: integer; s: string; begin for i := 1 to 30 do begin a[i] := random(6) - 3; end; writeln('Массив:'); for i := 0 to 30 do begin writeln('[', i, '] => ', a[i]); if (a[i] > 0) then begin o := o + a[i]; s := s + inttostr(i) + ' '; end; end; writeln('Номера положительных чисел: ', s); end.
var a:string;
i, o: Integer;
p: Real;
begin
readln(o);
a := inttostr(o);
for i := 1 to length(a) do
p := p + strtoint(a[i]);
if (sqr(o) = p*p*p) then writeln('true')
else writeln('false');
end.
2)
var a:string;
i, o, p: Integer;
begin
readln(o);
a := inttostr(o);
for i := 1 to length(a) do
p := p + strtoint(a[i]);
if (p mod 3 = 0) then writeln('true')
else writeln('false');
end.
3)
var a, b, c: real;
begin
readln(a, b, c);
if ((a = b) and (b = c)) then writeln('true')
else writeln('false');
end.
Всё проверено, удачи:)
1)
var a: array [0..9] of integer;
i, o: integer;
begin
for i := 1 to 20 do
begin
if (i mod 4 = 0) then a[o] := i
else if (i mod 4 = 2) then a[o] := -1 * i;
if (i mod 4 mod 2 = 0) then o := o + 1;
end;
for i := 0 to 9 do
writeln(a[i]);
end.
2)
var a: array [0..30] of integer;
i, o: integer;
s: string;
begin
for i := 1 to 30 do
begin
a[i] := random(6) - 3;
end;
writeln('Массив:');
for i := 0 to 30 do
begin
writeln('[', i, '] => ', a[i]);
if (a[i] > 0) then
begin
o := o + a[i];
s := s + inttostr(i) + ' ';
end;
end;
writeln('Номера положительных чисел: ', s);
end.