Những câu hỏi liên quan
Nông trang
Xem chi tiết
Nguyễn Lê Phước Thịnh
5 tháng 5 2021 lúc 13:05

const fi='dulieu.txt'

fo='ketqua.txt'

var f1,f2:text;

m,n,i,t:integer;

begin

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

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

readln(f1,m,n);

t:=0;

for i:=m to n do 

 if i mod 2=0 then t:=t+i;

writeln(f2,t);

close(f1);

close(f2);

end.

Bình luận (0)
Nguyễn Cảnh Hùng
Xem chi tiết
Đỗ Ngọc Trinh
11 tháng 12 2018 lúc 4:12

Var f1, f2: text;

  Tong, m, n, i: integer;

Begin

  assign(f1, ‘DULIEU.TXT’);

  reset(f1);

  assign(f2, ‘KETQUA’);

  rewrite(f2);

  Tong;= 0;

  read(f1, m, n);

  for i:= m to n do

  if i mod 2 = 0 then Tong:= Tong+i;

  write(f2, Tong);

  close(f1);

  close(f2);

End.

Bình luận (0)
Nguyễn Cảnh Hùng
Xem chi tiết
Đỗ Ngọc Trinh
25 tháng 6 2018 lúc 3:32

Var f1, f2: text;

  Tong, m, n, i: integer;

Begin

  assign(f1, ‘DULIEU.TXT’);

  reset(f1);

  assign(f2, ‘KETQUA’);

  rewrite(f2);

  Tong;= 0;

  read(f1, m, n);

  for i:= m to n do

  if i mod 2 = 1 then Tong:= Tong+i;

  write(f2, Tong);

  close(f1);

  close(f2);

End.

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

#include <bits/stdc++.h>

using namespace std;

long long a,b;

int main()

{

freopen("dulieu.txt","r",stdin);

freopen("ketqua.txt","w",stdout);

cin>>a>>b;

cout<<max(a,b);

return 0;

}

Bình luận (0)
Nguyễn Cảnh Hùng
Xem chi tiết
Đỗ Ngọc Trinh
31 tháng 8 2018 lúc 16:53

Var f1, f2: text;

  Tong, m, n, i: integer;

Begin

  assign(f1, ‘DULIEU.TXT’);

  reset(f1);

  assign(f2, ‘KETQUA’);

  rewrite(f2);

  Tong;= 0;

  read(f1, m, n);

  for i:= m to n do

  if i mod 2 = 0 then Tong:= Tong+i;

  write(f2, Tong);

  close(f1);

  close(f2);

End.

Bình luận (0)
Nguyễn Cảnh Hùng
Xem chi tiết
Đỗ Ngọc Trinh
7 tháng 4 2019 lúc 15:31

Var f1, f2: text;

  Tong, m, n, i: integer;

Begin

  assign(f1, ‘DULIEU.TXT’);

  reset(f1);

  assign(f2, ‘KETQUA’);

  rewrite(f2);

  Tong;= 0;

  read(f1, m, n);

  for i:= m to n do

  if i mod 2 = 0 then Tong:= Tong+i;

  write(f2, Tong);

  close(f1);

  close(f2);

End.

Bình luận (0)
Kiên Tạ
Xem chi tiết
Nguyễn Lê Phước Thịnh
25 tháng 2 2021 lúc 20:46

const fi='dulieu.txt'     

fo='ketqua.txt'

var f1,f2:text;   

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

i,n,dem,dem1: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;

dem:=0;

dem1:=0;

for i:=1 to n do 

if a[i]>b[i] then     

begin       

inc(dem);       

inc(dem1);       

c[dem]:=a[i];       

d[dem]:=b[i];     

end 

else begin         

inc(dem);         

inc(dem1);         

c[dem]:=b[i];         

d[dem]:=a[i];       

end;

for i:=1 to dem do 

write(f2,c[i]:4);

writeln(f2);

for i:=1 to dem1 do 

write(f2,d[i]:4);

close(f1);

close(f2);

end.

Bình luận (0)
hậu huỳnh
Xem chi tiết
Nguyễn Lê Phước Thịnh
11 tháng 2 2020 lúc 19:16

Bài 1:

const fi='input.txt';

fo='output.txt';

var f1,f2:text;

a,b,s:integer;

begin

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

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

readln(f1,a,b);

s:=a*b;

writeln(f2,s);

close(f1);

close(f2);

end.

Bài 2:

const fi='dulieu.txt';

fo='ketqua.txt';

var f1,f2:text;

a,b:integer;

begin

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

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

readln(f1,a,b);

if a>b then writeln(f2,a)

else if b>a then writeln(f2,b)

else writeln(f2,' khong co so lon nhat trong hai so');

close(f1);

close(f2);

end.

Bình luận (0)
 Khách vãng lai đã xóa
Mĩ Lâm
Xem chi tiết
Nguyên Hưng Trần
22 tháng 7 2021 lúc 21:25

Uses crt;
var f1,f2:text;
    i,n,tong,tongchan,dem:integer;
    tb:real;
Begin
 clrscr;
 Assign(f1,'DAYSO.txt');
 Assign(f2,'KETQUA.txt');
 reset(f1);dem:=0;tong:=0;tongchan:=0;
 While Not EOF(f1) do
  Begin
  read(f1,i);
  inc(tong,i);
  If i mod 2 = 0 then
    begin
    inc(dem);
    inc(tongchan,i);
    end;
  End;
 tb:=tongchan/dem;
 close(f1);
 rewrite(f2);
 writeln(f2,tong);
 writeln(f2,tongchan);
 writeln(f2,tb:0:2);
 close(f2);
 write(tong);
 readln;
End.

Bình luận (0)
Minh
Xem chi tiết
Nguyễn Lê Phước Thịnh
4 tháng 5 2021 lúc 13:08

const fi='input.inp'

fo='output.out'

var a,b:integer;

f1,f2:text;

begin

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

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

readln(f1,a,b);

if a<b then writeln(f2,a)

else writeln(f2,b);

close(f1);

close(f2);

end.

Bình luận (1)