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.

24 tháng 2 2022

Làm bằng pascal thì những bài như thế này thì test lớn chạy không nổi đâu bạn

#include <bits/stdc++.h>

using namespace std;

long long n,a,b;

int main()

{

cin>>n;

a=1;

while (pow(a,3)<=n) 

{

a++;

}

if (pow(a,3)==n) cout<<"YES";

else cout<<"NO";

cout<<endl;

b=1;

while (pow(5,b)<=n) do b++;

if (pow(5,b)==n) cout<<"YES";

else cout<<"NO";

cout<<endl<<pow(n,n)%7;

return 0;

}

24 tháng 2 2022

mik chỉ làm mỗi câu là một bài thôi bạn

17 tháng 12 2021

#include <bits/stdc++.h>

using namespace std;

long long n,x;

int main()

{

cin>>n>>x;

cout<<pow(n,x);

return 0;

}

18 tháng 7 2023

THAM KHẢO!

def is_prime(n):

 if n <= 1:

  return "KHÔNG"# Trường hợp n <= 1 không phải số nguyên tố

 elif n <= 3:

  return "CÓ"# Trường hợp n = 2 hoặc n = 3 là số nguyên tố

 elif n % 2 == 0:

  return "KHÔNG"# Trường hợp n chẵn lớn hơn

 
5 tháng 3 2020

Bài 1:

Program hotrotinhoc;

var a,b,c,d,max: integer;

begin

write('Nhap a,b,c,d :'); readln(a,b,c,d);

max:=0;

if a>max then max:=a;

if b>max then max:=b;

if c>max then max:=c;

if d>max then max:=d;

write(max);

readln

end.

Bài 2:

Program hotrotinhoc;

var a,b,c : integer;

begin

write('Nhap 3 canh a,b,c'); readln(a,b,c);

if (a+b>c) or (a+c>b) or (b+c>a) then write('Thoa man') else ('Khong thoa man trong tung truong hop tuong ung');

readln

end.

Bài 4: Câu hỏi của Quỳnh Như - Tin học 8 | Học trực tuyến

Bài 5:

Program hotrotinhoc;

var a,n: integer;

t: longint;

begin

Write('Nhap a,n :'); readln(a,n);

t:=1;

for i:=1 to n do

t:=t*a;

write(t);

readln

end.

4 tháng 1 2017

a)

uses crt;

VAR

n, d, i: integer;

BEGIN

clrscr;

Writeln ('Nhap vao n='); readln (n);

d : = 1;

For i: = 1 to n do

d: = d*i;

Writeln ('d=',d);

Readln;

END.

c)

uses crt;

VAR

n, i, demuoc: integer;

BEGIN

clrscr;

Writeln ('Nhap vao n='); readln (n);

demuoc: = 0;

For i: = 1 to n do

If n mod i = 0 then

demuoc : = demuoc + 1;

If demuoc = 2 then

Writeln ('n la so nguyen to')

ELSE

Writeln ('n khong phai la so nguyen to');

Readln ;

END.

Còn phần b bạn tự nghĩ nha!

Chúc bạn học tốt!

24 tháng 11 2024

MÀY LÀ MỘT CON CHÓ NGU L NHẤT T TỪNG BIẾT 

ĐCM HƯƠNG TRÀ

ĐCM HƯƠNG TRÀ

ĐCM HƯƠNG TRÀ

CÁI J QUAN TRONG NHẮC LẠI 3 LẦN NHA CON ĐĨ NGU

 

7 tháng 6 2020

Câu 2:

Program HOC24;

var i,n,m: integer;

tb,tb1: longint;

a,b: array[1..32000] of integer;

begin

write('Nhap so N : '); readln(n);

tb:=0;

for i:=1 to n do

begin

write('Nhap so thu ',i,' : '); readln(a[i]);

tb:=tb+a[i];

end;

write('Nhap so M : '); readln(n);

tb1:=0;

for i:=1 to m do

begin

write('Nhap so thu ',i,' : '); readln(b[i]);

tb1:=tb1+b[i];

end;

if (tb/n)>(tb1/m) then write('Trung binh cong cua N so lon hon M so')

else write('Trung binh cong cua M so lon hon N so')

else (tb/n)=(tb1/m) then write('Trung binh cong cua M so bang hon N so');

readln

end.

7 tháng 6 2020

Câu 1:

Program HOC24;

var s,st: string;

n,i,j: integer;

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

function chuyen(x: string): string;

begin

x[1]:=upcase(x[1]);

chuyen:=x;

end;

begin

write('Nhap xau : '); readln(s);

while s[1]=#32 do delete(s,1,1);

while s[length(s)]=#32 do delete(s,length(s),1);

while pos(#32#32,s)<>0 do delete(s,pos(#32#32,s),1);

writeln('Xau sau khi xoa dau cach : ',s);

st:=s;

s:=s+' ';

while length(s)<>0 do

begin

st:=copy(s,1,pos(' ',s)-1);

n:=n+1;

a[n]:=st;

delete(s,1,pos(' ',s));

end;

write('Cac ki tu in hoa dau tien cua moi tu : ');

for i:=1 to n do write(chuyen(a[i]),' ');

writeln;

writeln('Vi tri cuoi cung cua ki tu cuoi cung so : ',length(st));

write('Sau khi xoa tu cuoi cung : ');

for i:=1 to n-1 do write(chuyen(a[i]),' ');

readln

end.

18 tháng 10 2020

Bài 1:

uses crt;
var a,b:array[1..100]of integer;
i,n,dem,t,dem1,max,tam,j,kt:integer;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
dem:=0;
for i:=1 to n do
if a[i] mod 2<>0 then inc(dem);
writeln('So luong so le la: ',dem);
t:=0;
for i:=1 to n do
if a[i] mod 5=0 then t:=t+a[i];
writeln('Tong cac phan tu chia het cho 5 la: ',t);
dem1:=0;
for i:=1 to n do
if a[i] mod 2=0 then
begin
inc(dem1);
b[dem1]:=a[i];
end;
max:=b[1];
for i:=1 to dem1 do
if max<b[i] then max:=b[i];
writeln('Phan tu chan lon nhat la: ',max);
writeln('Vi tri cua no trong mang la: ');
for i:=1 to n do
if max=a[i] then write(i:4);
writeln;
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;
writeln('Mang duoc sap xep tang dan la: ');
for i:=1 to n do
write(a[i]:4);
writeln;
writeln('Cac so nguyen to trong day la: ');
for i:=1 to n do
if a[i]>1 then
begin
kt:=0;
for j:=2 to a[i]-1 do
if a[i] mod j=0 then kt:=1;
if kt=0 then write(a[i]:4);
end;
readln;
end.