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.
N = int(input())
A = 0
B = 0
So_uoc = 0
KQ = ""
for x in range(1, N):
if (x%2==0) and (x%3==0):
A += 1
if (x>0) and (N%x==0):
if (x>B):
B = x
for i in range(1, N+1):
if (N%i==0):
So_uoc += 1
if (So_uoc == 2):
KQ = "YES"
else:
KQ = "NO"
print(A)
print(B)
print(len(str(N)))
print(KQ)
(Chẳng biết đúng không đâu )
#include <bits/stdc++.h>
using namespace std;
long long n,i,x,t,dem,j;
int main()
{
cin>>n;
x=n;
t=0;
while (n>0)
{
t=t+n%10;
n=n/10;
}
cout<<t;
dem=0;
for (i=2; i<=x; i++)
{
bool kt=true;
for (j=2; j*j<=i; j++)
if (i%j==0) kt=false;
if (kt==true) dem++;
}
cout<<dem;
return 0;
}
const fi='snt.inp';
fo='snt.out';
var f1,f2:text;
n,i:integer;
a,b:array[1..100]of integer;
{-----------------ham-kiem-tra-so-nguyen-to-------------------------}
function ktra(x:integer):boolean;
var kt:boolean;
i:integer;
begin
kt:=true;
for i:=2 to x-1 do
if x mod i=0 then kt:=false;
if kt=true then ktra:=true
else ktra:=false;
end;
{---------------------chuong-trinh-chinh---------------------}
begin
assign(f1,fi); reset(f1);
assign(f2,fo); rewrite(f2);
readln(f1,n);
for i:=1 to n do
readln(f1,a[i],b[i]);
for i:=1 to n do
if ktra(a[i]-b[i])=true then writeln(f2,'YES')
else writeln(f2,'NO');
close(f1);
close(f2);
end.
uses crt;
var x,n,d,i:longint;
st,st1:string;
a:integer;
{----------------------chuong-trinh-con-tim-ucln---------------------}
function ucln(a,b:longint):longint;
var t:longint;
begin
t:=b mod a;
while t<>0 do
begin
t:=a mod b;
a:=b;
b:=t;
end;
ucln := a;
end;
{-------------------chuong-trinh-chinh-----------------}
begin
clrscr;
write('nhap x='); readln(x);
str(x,st);
d:=length(st);
st1:='';
for i:=d downto 1 do
st1:=st1+st[i];
val(st1,n,a);
if ucln(x,n)=1 then writeln('Phai')
else writeln('khong phai');
readln;
end.
#include <iostream>
using namespace std;
int main()
{
int n,i,j;
cout<<"Nhap n="; cin>>n;
for (i=1; i<=n; i++)
{
for (j=i; j<=i+n-1; j++)
cout<<j<<" ";
cout<<endl;
}
return 0;
}
#include <iostream>
using namespace std;
int main()
{
int n,i,j;
cout<<"Nhap n="; cin>>n;
for (i=1; i<=n; i++)
{
for (j=i; j<=i+n-1; j++)
cout<<j<<" ";
cout<<endl;
}
return 0;
}
#include <bits/stdc++.h>
using namespace std;
long long a[1000],n,i;
int main()
{
freopen("dayd.inp","r",stdin);
freopen("dayd.out","w",stdout);
cin>>n;
for (i=1; i<=n; i++) cin>>a[i];
for (i=1; i<=n; i++)
if (a[i]>0) cout<<a[i]<<" ";
return 0;
}
PASCAL Ạ