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
Thanh Vjp pro
Xem chi tiết
Ngô Chí Thành
Xem chi tiết
Nguyễn Lê Phước Thịnh
11 tháng 4 2021 lúc 17:59

const fi1='nguyen1.txt'

fi2='nguyen2.txt'

fo='nguyen.txt'

var f1,f2,f3:text;

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

n,m,i:integer;

begin

assign(f1,fi1); reset(f1);

assign(f2,fi2); reset(f2);

assign(f3,fo); rewrite(f3);

n:=0;

while not eof(f1) do 

  begin

inc(n);

readln(f1,a[n]);

end;

m:=0;

while not eof(f2) do 

begin

m:=m+1;

readln(f1,b[m]);

end;

for i:=1 to n do 

 writeln(f3,a[i]);

for i:=1 to m do 

  writeln(f3,b[i]);

close(f1);

close(f2);

close(f3);

end.

Bùi Thị Ngọc
Xem chi tiết
Hậuu
Xem chi tiết
Nguyễn Lê Phước Thịnh
27 tháng 4 2021 lúc 20:58

const fi='data.inp'

fo='kq.out'

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 eoln(f1) do 

  begin

inc(n);

read(f1,a[n]);

end;

t:=0;

for i:=1 to n do 

  t:=t+a[i];

writeln(f2,t/n:4:2);

close(f1);

close(f2);

end.

Hoàng Long
Xem chi tiết
Nguyễn Lê Phước Thịnh
25 tháng 2 2021 lúc 21:49

const fi='input.txt'

fo='chiahet.txt'

var f1,f2:text;

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

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

dem:=0;

for i:=1 to n do

if a[i] mod 3=0 then inc(dem);

writeln(f2,dem);

close(f1);

close(f2);

end.

Hoàng Văn long
Xem chi tiết
Hello Det
2 tháng 5 2022 lúc 10:54

code c++: 

#include <iostream>
using namespace std;
int main()
{
    freopen("tbc.inp","r",stdin);
    freopen("tbc.out","w",stdout);
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    float r;
    r=(a+b+c+d)/4;
    cout<<r<<endl;
    return 0;

}

code pascal:

Lê Thị Hồng Trang
Xem chi tiết
Nguyễn Lê Phước Thịnh
31 tháng 3 2022 lúc 22:46

uses crt;

const fi='so.inp'

var f1:text;

a,b:integer;

begin

clrscr;

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

while not eof(f1) do 

 begin

readln(f1,a,b);

writeln((a+b)/2:4:2);

end;

close(f1);

readln;

end.

33. PHAN THỊ HỒNG THẮM 1...
Xem chi tiết
U Lan
Xem chi tiết