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

Bình luận (0)
33. PHAN THỊ HỒNG THẮM 1...
Xem chi tiết
Thành Đạt.
Xem chi tiết
Nguyễn Lê Phước Thịnh
28 tháng 4 2021 lúc 19:30

uses crt;

const fi='dulieuvao.dat'

var f1:text;

a,b,c,d,e:array[1.1.00]of integer;

n,m,d,x,v,t,t1,t2,t3,t4,t5,i:integer;

begin

clrscr;

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

n:=0;

while not eoln(f1) do 

  begin

n:=n+1;

read(f1,a[n]);

end;

readln(f1);

m:=0;

while not eoln(f1) do 

 begin

inc(m);

read(f1,b[m]);

end;

readln(f1);

d:=0;

while not eoln(f1) do 

 begin

inc(d);

read(f1,c[d]);

end;

readln(f1);

x:=0;

while not eoln(f1) do 

 begin

inc(x);

read(f1,d[x]);

end;

readln(f1);

v:=0;

while not eoln(f1) do 

 begin

inc(v);

read(f1,e[v]);

end;

t:=0;

for i:=1 to n do 

  t:=t+a[i];

writeln('Tong cua day 1 la: ',t);

t1:=0;

for i:=1 to m do 

  t1:=1+b[i];

writeln('Tong cua day 2 la: ',t1);

t2:=0;

for i:=1 to d do 

  t2:=t2+c[i];

writeln('Tong cua day 3 la: ',t2);

t3:=0;

for i:=1 to x do 

  t3:=t3+d[i];

writeln('Tong cua day 4 la: ',t3);

t4:=0;

for i:=1 to v do 

  t4:=t4+e[i];

writeln('Tong cua day 5 la: ',t4);

close(f1);

readln;

end.

Bình luận (0)
Nguyễn Văn Thường
Xem chi tiết
Nguyễn Lê Phước Thịnh
28 tháng 2 2022 lúc 18:51

const fi='input.txt'

fo='soan.txt'

var f1,f2:text;

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

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

for i:=1 to n do 

  if a[i]<0 then writeln(f2,a[i]:4);

close(f1);

close(f2);

end.

Bình luận (0)
Ngô Chí Thành
Xem chi tiết
Nguyễn Lê Phước Thịnh
11 tháng 4 2021 lúc 19:51

uses crt;

const fi='tamgiac.dat'

var f1:text;

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

n,i,j,k,dem:integer;

begin

clrscr;

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

n:=0;

while not eof(f1) do 

  begin

inc(n);

readln(f1,a[n],b[n],c[n]);

end;

dem:=0;

for i:=1 to n do 

for j:=1 to n do 

for k:=1 to n do

if (i=j) and (j=k) then

begin

  if (a[i]+b[j]>c[k]) and (a[i]+c[k]>b[j]) and (c[k]+b[j]>a[i]) then

  begin

if (a[i]=b[j]) and (a[i]<>c[k]) and (b[j]<>c[k]) then inc(dem);

if (a[i]=c[k]) and (a[i]<>b[j]) and (c[k]<>b[j]) then inc(dem);

if (b[j]=c[k]) and (b[j]<>a[i]) and (c[k]<>a[i]) then inc(dem);

end;

end;

writeln(dem);

readln;

end.

Bình luận (0)
Trần Trọng Hùng
Xem chi tiết
Nguyễn Lê Phước Thịnh
13 tháng 3 2022 lúc 11:20

#include <bits/stdc++.h>
using namespace std;
unsigned long long a[1000],i,n,uc;
//chuongtrinhcon
unsigned long long ucln(long long a,long long b)
{
    if (b==0) return(a);
    else return(ucln(b,a%b));
}
//chuongtrinhchinh
int main()
{
    freopen("sn3.inp","r",stdin);
    freopen("uc.out","w",stdout);
    cin>>n;

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

uc=ucln(a[1],a[2]);

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

uc=ucln(uc,a[i]);

cout<<uc;
    return 0;
}

 

Bình luận (1)
Đỗ Ngọc Linh
Xem chi tiết
Louis Kai
Xem chi tiết
Đubaii Tin
Xem chi tiết