K
Khách

Hãy nhập câu hỏi của bạn vào đây, nếu là tài khoản VIP, bạn sẽ được ưu tiên trả lời.

Bài 1:

uses crt;

const fi='ketqua.txt';

var f1:text;

a,b,t:integer;

begin

clrscr;

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

write('a='); readln(a);

write('b='); readln(b);

t:=a+b;

writeln(f1,t);

close(f1);

readln;

end.

Bài 2:

uses crt;

const fi='dulieu.txt';

var f1:text;

a,b,t:integer;

begin

clrscr;

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

readln(f1,a,b);

t:=a+b;

writeln('tong cua hai so la: ',t);

close(f1);

readln;

end.

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.

11 tháng 12 2018

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.

25 tháng 6 2018

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.

31 tháng 8 2018

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.

7 tháng 4 2019

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.

#include <bits/stdc++.h>

using namespace std;

long long x,y;

int main()

{

cin>>x>>y;

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

cout<<x+y<<endl;

cout<<x-y<<endl;

cout<<x*y<<endl;

cout<<fixed<<setprecision(2)<<(x*1.0)/(y*1.0);

return 0;

}

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.

uses crt;

const fi='dulieu.txt';

var f1:text;

a,b,c:integer;

begin

clrscr;

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

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

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

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

writeln(f1,a);

writeln(f1,b);

writeln(f1,c);

close(f1);

end.