program var s: string; a:array[1..4] of integer; i:integer; begin read(s); for i:=1 to 4 do a[i]:=0;
for i:=0 to length(s) do begin if s[i]=')' then inc(a[1]); if s[i]='(' then inc(a[2]); if s[i]='!' then inc(a[3]); if s[i]='.' then inc(a[4]); end;
if(a[1]>a[2])and(a[1]>a[3])and(a[1]>a[4]) then write('Funny')else if(a[2]>a[1])and(a[2]>a[3])and(a[2]>a[4]) then write('Sad') else if(a[3]>a[2])and(a[3]>a[1])and(a[3]>a[4]) then write('Angry') else if(a[4]>a[2])and(a[4]>a[3])and(a[4]>a[1]) then write('Deep') else write('Unclear');
1. Ввод с клавиатуры var p,i:integer; a:array [1..10] of integer;
begin p:=-1;
for i:=1 to 10 do begin readln (a [i]); end;
while p = -1 do begin for i:=1 to 10 do begin if (a [i] < 3) then p:=1; end; end;
for i:=1 to 10 do begin if (a [i] < 3) then p:=p*a [i]; end; writeln (p); end.
2.Рандом
var p,i:integer; a:array [1..10] of integer;
begin p:=-1;
for i:=1 to 10 do begin a [i]:=Random (10); end; write ('Наш массив: '); for i:=1 to 10 do begin write (a [i]); write (' '); end; writeln (' '); while p = -1 do begin for i:=1 to 10 do begin if (a [i] < 3) then p:=1; end; end;
for i:=1 to 10 do begin if (a [i] < 3) then p:=p*a [i]; end; writeln ('Произведение = ',p); end.
var
s: string;
a:array[1..4] of integer;
i:integer;
begin
read(s);
for i:=1 to 4 do a[i]:=0;
for i:=0 to length(s) do
begin
if s[i]=')' then inc(a[1]);
if s[i]='(' then inc(a[2]);
if s[i]='!' then inc(a[3]);
if s[i]='.' then inc(a[4]);
end;
if(a[1]>a[2])and(a[1]>a[3])and(a[1]>a[4]) then write('Funny')else
if(a[2]>a[1])and(a[2]>a[3])and(a[2]>a[4]) then write('Sad') else
if(a[3]>a[2])and(a[3]>a[1])and(a[3]>a[4]) then write('Angry') else
if(a[4]>a[2])and(a[4]>a[3])and(a[4]>a[1]) then write('Deep') else
write('Unclear');
end.
var
p,i:integer;
a:array [1..10] of integer;
begin
p:=-1;
for i:=1 to 10 do begin
readln (a [i]);
end;
while p = -1 do begin
for i:=1 to 10 do begin
if (a [i] < 3) then p:=1;
end;
end;
for i:=1 to 10 do begin
if (a [i] < 3) then
p:=p*a [i];
end;
writeln (p);
end.
2.Рандом
var
p,i:integer;
a:array [1..10] of integer;
begin
p:=-1;
for i:=1 to 10 do begin
a [i]:=Random (10);
end;
write ('Наш массив: ');
for i:=1 to 10 do begin
write (a [i]);
write (' ');
end;
writeln (' ');
while p = -1 do begin
for i:=1 to 10 do begin
if (a [i] < 3) then p:=1;
end;
end;
for i:=1 to 10 do begin
if (a [i] < 3) then
p:=p*a [i];
end;
writeln ('Произведение = ',p);
end.