Những câu hỏi liên quan
Nguyễn Đức Anh Khoa
Xem chi tiết
Nguyễn Lê Phước Thịnh
14 tháng 1 2021 lúc 12:30

const fi='tong.inp'

fo='tong.out'

var f1,f2:text;

a:array[1..100]of integer;

n,i,t:integer;

begin

assign(f1,fi); reset(f1);

assign(f2,fo); rewrite(f2);

readln(f1,n);

for i:=1 to n do 

  read(f1,a[i]);

t:=0;

for i:=1 to n do 

  t:=t+a[i];

writeln(f2,t);

close(f1);

close(f2);

end.

Bình luận (0)
Dương Hữu Thành
Xem chi tiết
Phạm Đức Huy
Xem chi tiết
Mạnh Cường Đào Huỳnh
Xem chi tiết
Nguyễn Lê Phước Thịnh
12 tháng 5 2022 lúc 23:55

const fi='input.txt'

fo='output.txt'

var f1,f2:text;

a:array[1..100]of integer;

i,n,t:integer;

begin

assign(f1,fi); reset(f1);

assign(f2,fo); rewrite(f2);

n:=0;

while not eof(f1) do 

begin

inc(n);

read(f1,a[n]);

end;

t:=0;

for i:=1 to n do t:=t+a[i];

write(f2,t);

close(f1);

close(f2);

end.

Bình luận (0)
Felix MC-Gamer
Xem chi tiết
33. PHAN THỊ HỒNG THẮM 1...
Xem chi tiết
Thùy Linh Ngô
Xem chi tiết
Nguyễn Lê Phước Thịnh
30 tháng 12 2021 lúc 23:29

1:

uses crt;

const fi='songuyen.doc'

var i:integer;

f1:text;

begin

clrscr;

assign(f1,fi); rewrite(f1);

for i:=1 to 10 do write(f1,i:4);

close(f1);

readln;

end.

Bình luận (0)
Đàm Tường
Xem chi tiết
tao quen roi
18 tháng 3 2017 lúc 12:34

var a,b:text;
s:integer;

begin
assign(a,'number.txt');
assign(b,'KQ.txt');
reset(a);
rewrite(b);
while not eof(a) do
begin
read(a,s);
if s mod 3 =0 then
writeln(b,'s=',s,s:3);
end;
close(a);
close(b);
readln
end.

Bình luận (0)
Nguyễn Thị In
Xem chi tiết
Nguyễn Lê Phước Thịnh
8 tháng 3 2022 lúc 7:04

const fi='dulieu.txt'

fo='ketqua.txt'

var f1,f2:text;

a,b:array[1..100]of integer;

n,i:integer;

begin

assign(f1,fi); reset(f1);

assign(f2,fo); rewrite(f2);

n:=0;

while not eof(f1) do

begin

n:=n+1;

readln(f1,a[n],b[n]);

end;

for i:=1 to n do 

begin

if (a[i]<b[i]) then writeln(f2,a[i])

else writeln(f2,b[i]);

end;

close(f1);

close(f2);

end.

Bình luận (0)