Những câu hỏi liên quan
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)
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)
Minh Uzumaki
Xem chi tiết
Nguyễn Lê Phước Thịnh
10 tháng 5 2022 lúc 23:08

#include <bits/stdc++.h>

using namespace std;

long long m,n,t,i;

int main()

{

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

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

cin>>m>>n;

t=0;

for (i=m; i<=n; i++)

if (i%2!=0) t+=i;

cout<<t;

return 0;

}

Bình luận (0)
Nguyễn thị Phụng
Xem chi tiết
Nguyễn Lê Phước Thịnh
17 tháng 6 2020 lúc 12:30

const fi='dulieu.txt';

fo='ketqua.txt';

var f1,f2:text;

m,n,t,i: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 3=0 then t:=t+i;

writeln(f2,t);

close(f1);

close(f2);

end.

Bình luận (0)
help me
Xem chi tiết
Nguyễn Lê Phước Thịnh
12 tháng 2 2020 lúc 11:38

const fi='dulieu.txt';
fo='ketqua.txt';
var i,t:integer;
f1,f2:text;
a:array[1..9]of integer;
begin
assign(f1,fi); reset(f1);
assign(f2,fo); rewrite(f2);
t:=0;
for i:=1 to 9 do
begin
read(f1,a[i]);
t:=t+a[i];
end;
writeln(f2,t);
close(f1);
close(f2);
end.

Bình luận (0)
 Khách vãng lai đã xóa
Lê Tràn Diễm My
Xem chi tiết
Buddy
3 tháng 3 2021 lúc 20:42

a)

PROGRAM BAI1a;

VAR N, Tle, Tchan: integer;

BEGIN

          Write ('Nhap N =');

          Readln (N);

          If (N mod 2) = 0 Then

          Tle := N*((N - 2)/2 + 1)/2;

          Tchan := (N + 2)*((N - 2)/2 + 1)/2;

          If (N mod 2) = 1 Then

          Tle := (N + 1)*((N-1)/2 +1)/2;

          Tchan := (N + 1)*((N - 3)/2 + 1)/2;

          WRITELN ('Sle =', Sle, 'Schan =', Schan);

          READLN;

          END.

Bình luận (3)
Bùi Anh Tuấn
3 tháng 3 2021 lúc 20:44

Bình luận (2)
Nguyễn Lê Phước Thịnh
3 tháng 3 2021 lúc 21:17

uses crt;

const fi='tong5.txt'

var f1:text;

n,i,t:integer;

begin

clrscr;

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

write('Nhap n='); readln(n);

t:=0;

for i:=1 to n do

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

writeln(f1,t);

close(f1);

readln;

end.

Bình luận (0)