const n=10;
var a:array [1..n] of integer;
i,m:integer;
begin
m:=7;
write('Массив: ');
for i:=1 to n do
a[i]:=random(27)+7;
if a[i] > m then m:=a[i];
write(a[i],' ')
end;
writeln;
writeln('Наибольшее: ',m)
end.
import java.util.Random;
public class Test {
public static void main ( String args []) {
int max = 0;
int [] mas = new int [10];
Random rand = new Random();
for (int i = 0; i < 10 ; i++) {
mas[i] = rand.nextInt( 33 +1 );
while ( mas[i] < 7 || mas[i] > 33) {
}
System.out.print(mas[i] + " ");
System.out.println();
for(int i = 0; i < mas.length - 1; i++) {
if ( max < mas[i] ) max = mas[i];
System.out.println(max);
const n=10;
var a:array [1..n] of integer;
i,m:integer;
begin
m:=7;
write('Массив: ');
for i:=1 to n do
begin
a[i]:=random(27)+7;
if a[i] > m then m:=a[i];
write(a[i],' ')
end;
writeln;
writeln('Наибольшее: ',m)
end.
import java.util.Random;
public class Test {
public static void main ( String args []) {
int max = 0;
int [] mas = new int [10];
Random rand = new Random();
for (int i = 0; i < 10 ; i++) {
mas[i] = rand.nextInt( 33 +1 );
while ( mas[i] < 7 || mas[i] > 33) {
mas[i] = rand.nextInt( 33 +1 );
}
}
for (int i = 0; i < 10 ; i++) {
System.out.print(mas[i] + " ");
}
System.out.println();
for(int i = 0; i < mas.length - 1; i++) {
if ( max < mas[i] ) max = mas[i];
}
System.out.println(max);
}
}