Những câu hỏi liên quan
NGUYỄN THỊ KIM CHI
Xem chi tiết
Phạm Thị Thu Hằng
Xem chi tiết
Nguyễn Lê Phước Thịnh
4 tháng 5 2021 lúc 13:48

uses crt;

const fi='so.txt'

var f1:text;

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

n,i:integer;

begin

clrscr;

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

readln(f1,n);

for i:=1 to n do  

  read(f1,a[i]);

for i:=1 to n do 

  write(a[i]:4);

close(f1);

readln;

end.

Bình luận (0)
woo ok haen
Xem chi tiết
Huyền Nguyễn
Xem chi tiết
Nguyễn Lê Phước Thịnh
30 tháng 3 2022 lúc 20:37

#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ình luận (0)
Cương Hữu
Xem chi tiết
Nguyễn Lê Phước Thịnh
13 tháng 5 2020 lúc 11:26

uses crt;

const fi='so.txt';

var f1:text;

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

i,n:integer;

begin

clrscr;

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

n:=0;

while not eof(f1) do

begin

n:=n+1;

read(f1,a[n]);

end;

for i:=1 to n do

if a[i] mod 2=0 then write(a[i],' ');

close(f1);

readln;

end.

Bình luận (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;

}

Bình luận (0)
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)
Ka Ka
Xem chi tiết
Nguyễn Lê Phước Thịnh
17 tháng 3 2021 lúc 21:41

const fi='mang.txt'

fo='tong.txt'

var f1,f2:text;

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

n,i,t:integer;

begin

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

assign(f2,fo); rewriteln(f2);

n:=0;

while not eof(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);

close(f1);

close(f2);

end.

Bình luận (0)
Lan Ngọc
Xem chi tiết
Nguyễn Lê Phước Thịnh
10 tháng 1 2022 lúc 23:13

#include <bits/stdc++.h>

using namespace std;

long long a,b;

double tb;

int main()

{

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

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

cin>>a>>b;

cout<<a<<" "<<b;

cout<<fixed<<setprecision(2)<<(a*1.0+b*1.0)/(2*1.0);

return 0;

}

Bình luận (0)