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

Bình luận (0)
Phạm Tiến Vượng
Xem chi tiết
Phan Tú
Xem chi tiết
Ngọc Hồng
Xem chi tiết
Nguyễn Lê Phước Thịnh
17 tháng 3 2022 lúc 14:48

#include <bits/stdc++.h>

using namespace std;

long long a,b;

int main()

{

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

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

cin>>a>>b;

cout<<a*b;

return 0;

}

Bình luận (0)
An Hạ
Xem chi tiết
Nguyễn Lê Phước Thịnh
30 tháng 3 2021 lúc 20:25

uses crt;

const fi='data.txt'

var f1:text;

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

n,i: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]:4);

close(f1);

readln;

end.

Bình luận (0)
Quỳnh Như
Xem chi tiết
Nguyễn Lê Phước Thịnh
10 tháng 5 2022 lúc 23:21

uses crt;

const fi='songuyen.inp'

fo='songuyen2.out'

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

i,n,t1:integer;

f1,f2:text;

begin

clrscr;

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

assign(f2,fo); rewrite(f2);

readln(f1,n);

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

t1:=0;

for i:=1 to n do if a[i] mod 2<>0 then t1:=t1+a[i];

writeln(t1);

writeln(f2,t1);

for i:=1 to n do 

  if a[i] mod 2<>0 then write(a[i]:4);

close(f1);

close(f2);

readln;

end.

Bình luận (0)
Tran Ngô
Xem chi tiết
Nguyễn Lê Phước Thịnh
25 tháng 2 2021 lúc 13:39

const fi='data.txt'

fo='tbc.txt'

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);

n:=0;

while not eof(f1) do 

  begin

n:=n+1;

readln(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.

Bình luận (1)
33. PHAN THỊ HỒNG THẮM 1...
Xem chi tiết
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)