Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type
- vector = array[1..40] of integer;
- var
- x,y,z: vector;
- n,i: integer;
- max_x, max_z_pos: integer;
- is_y_negative: boolean;
- function max(a: real; b: real): real;
- begin
- if a>b then
- max:=a
- else
- max:=b;
- end;
- begin
- readln(n);
- max_x := -1000000;
- for i:=1 to n do
- begin
- read(x[i]);
- max_x := max(max_x, x[i]);
- end;
- is_y_negative:=true;
- for i:=1 to n do
- begin
- read(y[i]);
- if is_y_negative and (y[i]>0) then
- is_y_negative:=false;
- end;
- max_z_pos:= 1;
- read(z[1]);
- for i:=2 to n do
- begin
- read(z[i]);
- if z[i]>z[max_z_pos] then
- max_z_pos:=i;
- end;
- if (max_x = 10) and (is_y_negative) then
- for i:=1 to max_z_pos-1 do
- z[i]:=z[i]*z[i]*z[i];
- for i:=1 to n do
- write(z[i],' ');
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement