Tin học Đề thi tự luận tin học 11

Nguyễn Hoài Thơm

Học sinh mới
Thành viên
11 Tháng năm 2018
4
0
1
22
Tuyên Quang
THPT Na Hang

ka1412

Học sinh chăm học
Thành viên
24 Tháng mười một 2017
874
730
121
Hà Nội
CNN | Life
Mã:
uses crt;
var a:array[1..100] of integer;
n,i,max:integer;
f:text;
begin
clrscr;
assign(f,'int.dat');reset(f);i:=1;
while not eof(f) do
begin
    read(f,a[i]);
if i=1 then max:=a[i] else if a[i]>max then max:=a[i];
inc(i);
end;
close(f);
assign(f,'out.txt');rewrite(f);
write(f,max);
close(f);
readln
end.
Có gì sai thì bảo mình nha
 
Last edited:

Nguyễn Hoài Thơm

Học sinh mới
Thành viên
11 Tháng năm 2018
4
0
1
22
Tuyên Quang
THPT Na Hang
Mã:
uses crt;
var a:array[1..100] of integer;
n,i,max:integer;
f:text;
begin
clrscr;
assign(f,'int.dat');reset(f);i:=1;
repeat
readln(f,a[i]);
if i=1 then max:=a[i] else if a[i]>max then max:=a[i];
inc(i);
until eof;
close(f);
assign(f,'out.txt');rewrite(f);
write(f,max);
close(f);
readln
end.
Có gì sai thì bảo mình nha
Mã:
uses crt;
var a:array[1..100] of integer;
n,i,max:integer;
f:text;
begin
clrscr;
assign(f,'int.dat');reset(f);i:=1;
repeat
readln(f,a[i]);
if i=1 then max:=a[i] else if a[i]>max then max:=a[i];
inc(i);
until eof;
close(f);
assign(f,'out.txt');rewrite(f);
write(f,max);
close(f);
readln
end.
Có gì sai thì bảo mình nha
 

ka1412

Học sinh chăm học
Thành viên
24 Tháng mười một 2017
874
730
121
Hà Nội
CNN | Life
Mình sửa lại r đấy
Mã:
uses crt;
var a:array[1..100] of integer;
n,i,max:integer;
f:text;
begin
clrscr;
assign(f,'int.dat');reset(f);i:=1;
while not eof(f) do
begin
    read(f,a[i]);
if i=1 then max:=a[i] else if a[i]>max then max:=a[i];
inc(i);
end;
close(f);
assign(f,'out.txt');rewrite(f);
write(f,max);
close(f);
readln
end.
Có gì sai thì bảo mình nha
 
Top Bottom