K
Khách

Hãy nhập câu hỏi của bạn vào đây, nếu là tài khoản VIP, bạn sẽ được ưu tiên trả lời.

31 tháng 8 2025

Bạn tham khảo code C++ nhé

15 tháng 10 2021

máy mình hơi yếu nên không cài được ide nha mình làm ide online nha

undefined

 

14 tháng 3 2021

undefinedundefinedundefinedundefined

15 tháng 12 2022

38C (Đề sai 1 chút ở đây không có lệnh in mà chỉ thực hiện công việc ở câu C thôi nhé)

39C

40A

4 tháng 5 2021

Câu 1: 

const fi='dulieu.dat';

fo='thaythe.out';

var f1,f2:text;

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

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

  begin

d:=length(a[i]);

vt:=pos('anh',a[i]);

while vt<>0 do 

  begin

delete(a[i],vt,3);

insert('em',a[i],vt);

vt:=pos('anh',a[i]);

end;

end;

for i:=1 to n do 

  writeln(f2,a[i]);

close(f1);

close(f2);

end.

4 tháng 5 2021

Câu 2: 

uses crt;

const fi='mang.inp';

fo='sapxep.out';

var f1,f2:text;

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

i,n,tam,j:integer;

begin

clrscr;

assign(f1,fi); rewrite(f1);

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

write('Nhap n='); readln(n);

for i:=1 to n do 

  begin

write('A[',i,']='); readln(a[i]);

end;

for i:=1 to n do 

  write(f1,a[i]:4);

for i:=1 to n-1 do 

  for j:=i+1 to n do 

if a[i]>a[j] then

begin

tam:=a[i];

a[i]:=a[j];

a[j]:=tam;

end;

for i:=1 to n do 

  write(f2,a[i]:4);

close(f1);

close(f2);

end.

23 tháng 12 2020

int BCNN(int a, int b)

{

int result = UCLN(a, b);

return a * b / result;

}

int main()

{

int a, b; cout << "a = ";

cin >> a;

cout << "b = ";

cin >> b;

int result = UCLN(a, b);

cout << "UCLN : "<<result; cout << "\n";

result = BCNN(a, b);

cout << "BCNN : " << result << endl;

system("pause");

}

Biết viết mỗi C++, Pascal thì miss gần hết :(

 

24 tháng 12 2020

uses crt;

var a,b,bcnn,i:longint;

begin

clrscr;

write('Nhap a='); readln(a);

write('Nhap b='); readln(b);

bcnn:=a*b;

for i:=a*b-1 downto 1 do 

  if (i mod a=0) and (i mod b=0) then 

   begin

if bcnn>i then bcnn:=i;

end;

writeln('Boi chung nho nhat la: ',bcnn);

readln;

end.