Like button



Thứ Năm, 23 tháng 2, 2012

java basic exercise 2

program timsomax;
uses crt;
const n=10;
var   a:array[1..n] of integer;
      i,max:integer;
begin
     clrscr;
     writeln('Nhap phan tu cho mang A');
     for i:=1 to n do
     begin
          write('A[',i,']= ');
          readln(a[i]);
     end;
     max:=a[1];
     for i:=2 to n do
         if max<a[i] then max=a[i];   
     writeln('Phan tu lon nhat trong mang la ',max);
     readln;
end.

Đọc thêm: http://hocvui.net/4rum/pascal/tim-phan-tu-lon-nhat-(hoac-nho-nhat)-trong-mang/#ixzz1nGUB9RYV
Hocvui.net - học những điều cơ bản

Không có nhận xét nào:

Đăng nhận xét