Bạn chưa đăng nhập. Vui lòng đăng nhập để hỏi bài

Những câu hỏi liên quan
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.

Khách vãng lai đã xóa
NT dũng
Xem chi tiết
Minh Lệ
7 tháng 5 2020 lúc 19:16

Bài 1:

Program hotrotinhoc_hoc24;

const fi='dulieu.txt';

var a,b: integer;

f: text;

procedure ip;

begin

assign(f,fi);

reset(f);

read(f,a,b);

close(f);

end;

begin

ip;

writeln('Tong la : ',a+b);

write('Hieu la : ',a-b);

readln

end.

Minh Lệ
7 tháng 5 2020 lúc 19:23

Program hotrotinhoc_hoc24;

const fi='dulieu.txt';

fo='ketqua.txt';

var f: text;

a,b,c : integer;

procedure ip;

begin

assign(f,fi);

reset(f);

read(f,a,b,c);

close(f);

end;

procedure out;

begin

assign(f,fo);

rewrite(f);

if (a+b>c) and (a+c>b) and (b+c>a) then write(f,a+b+c);

close(f);

end;

begin

ip;

out;

end.

Linh
Xem chi tiết
Nguyễn Lê Phước Thịnh
8 tháng 3 2022 lúc 23:00

#include <bits/stdc++.h>

using namespace std;

long long n,i,t;

int main()

{

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

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

cin>>n;

t=0;

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

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

cout<<t;

return 0;

}

Lê Đức Tài
Xem chi tiết
Nguyễn Lê Phước Thịnh
16 tháng 3 2022 lúc 14:06

#include <bits/stdc++.h>

using namespace std;

long long i,a[100],n;

int main()

{

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

n=20;

for (i=1; i<=n; i++) cin>>a[i];

for (i=1; i<=n; i++) cout<<a[i]<<" ";

return 0;

}

Minh Lệ
Xem chi tiết
Quoc Tran Anh Le
28 tháng 11 2023 lúc 0:56

a) Tên các ổ đĩa trên máy tính: ổ (D:), ổ (C:), ổ (E:).

b) Các em tự xem và trả lời.

Gợi ý:

Tên một số thư mục, tệp có trên ổ đĩa (D:):

Thư mục: Sach, giai tri, Program Files.

Tệp: tin 3.docx

c) Các em tham khảo các bước:

Mở thư mục sach trong ổ đĩa (D:) thư mục con là sach giao khoa và sach tham khoa

Tệp: Tin nang cao.docx

Hân Cao
Xem chi tiết
Nguyễn Lê Phước Thịnh
12 tháng 5 2022 lúc 7:46

uses crt;

const fi='dulieu.txt'

var f1:text;

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

t:real;

i,n:integer;

begin

clrscr;

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

readln(f1,n);

for i:=1 to n do readln(f1,a[i]);

t:=0;

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

writeln(t);

close(f1);

readln;

end.

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.

Vy Phạm Thị Gia
Xem chi tiết
Nguyễn Lê Phước Thịnh
2 tháng 3 2020 lúc 10:45

const fi='songuyen.txt';
fo='sole.txt';
var f1,f2:text;
n,i,t:integer;
a:array[1..100]of integer;
begin
assign(f1,fi); reset(f1);
assign(f2,fo); rewrite(f2);
n:=0;
while not eoln(f1) do
begin
inc(n);
read(f1,a[n]);
end;
t:=0;
for i:=1 to n do
if a[i] mod 2=1 then t:=t+a[i];
writeln(f2,t);
close(f1);
close(f2);
end.

Khách vãng lai đã xóa
Hoàng Ngọc nhi
Xem chi tiết
Nguyễn Lê Phước Thịnh
6 tháng 4 2021 lúc 12:37

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.