Буду считать, что да, он самый востребованный тут =) 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.
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.
s : String;
i : Integer;
begin
Writeln('Введите строку:');
Readln(s);
i:= 0;
while pos(')', s) <> 0 do
begin
i := i + pos(')', s) - pos('(', s) + 1;
delete(s, pos('(', s), pos(')', s) - pos('(', s) + 1);
end;
Writeln(s);
Writeln(i);
Readln;
end.
2)
var
s : String;
i, e : Integer;
flag : Boolean;
begin
Writeln('Введите строку:');
Readln(s);
e := 0;
flag := False;
for i := 1 to Length(s) do
begin
if (s[i] = UpCase(s[i])) and ((s[i - 1] = ' ') or ( i = 1 )) then flag := True;
if flag then Write(s[i]);
if (( s[i] = ' ' ) or ( i = Length(s))) and flag then
begin
flag := False;
inc(e);
Writeln;
end;
end;
Writeln(e);
Readln;
end.