Những câu hỏi liên quan
Huệ Bùi Thị Kim
Xem chi tiết
Nguyễn Lê Phước Thịnh
9 tháng 4 2022 lúc 10:04

#include <bits/stdc++.h>
using namespace std;
unsigned long long a,b;
//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("vidu.inp","r",stdin);
    freopen("vidu.out","w",stdout);
    cin>>a>>b;
    cout<<ucln(a,b);
    return 0;
}

 

Bình luận (0)
Thương Thương
Xem chi tiết
Đoàn Xuân Sơn
10 tháng 3 2022 lúc 1:04

const fi='nhap.txt'

uses crt;

var

f:text;

b:byte;

a:longint;

begin

clrscr;

assign(f,f1);

reset(f);

read(f,a,b);

close(f);

a:=exp(b*ln(a));

write('ket qua la: ',a);

readln;

end.

Bình luận (0)
trần nguyễn tuyết trinh
Xem chi tiết
Minh Lệ
9 tháng 4 2023 lúc 18:34

Program HOC24;

var i,n: integer;

c: array[1..1000] of integer;

f: text;

begin

assign(f,'MANG3.TXT');

reset(f);

readln(f,n);

for i:=1 to n do read(f,c[i]);

close(f);

for i:=1 to n do if c[i] mod 2=1 then write(c[i],' ');

readln

end.

Bình luận (0)
trần nguyễn tuyết trinh
9 tháng 4 2023 lúc 11:39

cứu e với mn

 

Bình luận (0)
trần nguyễn tuyết trinh
Xem chi tiết
LA VAN CAU
Xem chi tiết
Ly Trần
Xem chi tiết
Nguyễn Lê Phước Thịnh
20 tháng 4 2022 lúc 17:10

const fi='data1.txt'

fo='data2.txt'

var f1,f2:text;

a,b:real;

begin

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

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

readln(f1,a,b);

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

close(f1);

close(f2);

end.

Bình luận (0)
Xinh Xinh
Xem chi tiết
Minh Lệ
13 tháng 3 2021 lúc 13:21

Bạn nêu rõ dữ liệu vào nhé

Bình luận (0)
An Đinh
Xem chi tiết
Minh Lệ
19 tháng 3 2023 lúc 22:52

Program HOC24;

var i,n: integer;

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

t: longint;

f1,f2: text;

const fi='DATA1.TXT'

fo='KQ1.TXT'

begin

assign(f1,fi);

assign(f2,fo);

reset(f1);

rewrite(f2);

readln(f1,n);

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

t:=0;

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

writeln(f2,t);

for i:=1 to n do if a[i] mod 5=0 then write(f2,a[i],' ');

close(f1); close(f2);

end.

Bình luận (0)
U Lan
Xem chi tiết