Advertisement
tgbaodeeptry

Untitled

Apr 7th, 2021
697
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.37 KB | None | 0 0
  1. var
  2.     f1, f2: text;
  3.     max, x: real;
  4. begin
  5.     assign(f1, 'sothuc.txt'); reset(f1);
  6.     assign(f2, 'ketqua.txt'); rewrite(f2);
  7.  
  8.     if not eof(f1) then
  9.     begin
  10.         read(f1, x);
  11.         max := x;
  12.        
  13.         while not eof(f1) do
  14.         begin
  15.             read(f1, x);
  16.             if x > max then max := x;
  17.         end;
  18.  
  19.         write(f2, 'Ket qua la: ', max);
  20.     end
  21.     else
  22.         write(f2, 'Khong co so nao duoc nhap');
  23. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement