Hay viet chuong trinh nhap vao 10 so nguyen tu ban phim va in ra man hinh so lon nhat
0 bình luận về “Hay viet chuong trinh nhap vao 10 so nguyen tu ban phim va in ra man hinh so lon nhat”
uses crt; var a:array[1..1000] of longint; i,max:integer; begin clrscr; for i:=1 to 10 do begin write(‘Nhap phan tu thu ‘,i,’: ‘); readln(a[i]); end; max:=a[1]; for i:=1 to 10 do if a[i]>max then max:=a[i]; write(‘Phan tu lon nhat: ‘,max); readln; end.
program phuongt; uses crt; var A: array[1..10] of integer; i, n: integer; begin clrscr; for i:=1 to 10 do begin write(‘A[‘, i, ‘] = ‘); readln(A[i]); end; n:=A[1]; for i:=1 to 10 do if n<A[i] then n:=A[i]; write(‘So lon nhat: ‘, n); readln end.
uses crt;
var a:array[1..1000] of longint;
i,max:integer;
begin
clrscr;
for i:=1 to 10 do
begin
write(‘Nhap phan tu thu ‘,i,’: ‘); readln(a[i]);
end;
max:=a[1];
for i:=1 to 10 do if a[i]>max then max:=a[i];
write(‘Phan tu lon nhat: ‘,max);
readln;
end.
program phuongt;
uses crt;
var A: array[1..10] of integer;
i, n: integer;
begin
clrscr;
for i:=1 to 10 do
begin
write(‘A[‘, i, ‘] = ‘); readln(A[i]);
end;
n:=A[1];
for i:=1 to 10 do if n<A[i] then n:=A[i];
write(‘So lon nhat: ‘, n);
readln
end.