def is_prime(n):
if n <= 1:
return False
if n <= 3:
return True
if n % 2 == 0 or n % 3 == 0:
return False
i = 5
while i * i <= n:
if n % i == 0 or n % (i + 2) == 0:
return False
i += 6
return True
n = int(input())
if is_prime(n):
print("YES")
else:
print("NO")
Comments
là sao vậy mn?
như này sao sai đc vậy mn
include<bits/stdc++.h>
using namespace std;
int main () {
cout<<" "<<endl;
cout<<" *"<<endl;
cout<<" *"<<endl;
cout<<" **"<<endl;
cout<<" **"<<endl;
cout<<"**"<<endl;
cout<<" *"<<endl;
cout<<" *"<<endl;
cout<<" *"<<endl;
}
// đc ròi nè
print(' ')
print(' *')
print(' *')
print(' **')
print(' **')
print('**')
print(' *')
print(' *')
print(' *')
print(' * ')
print(' *** ')
print(' ***** ')
print(' ******* ')
print(' ********* ')
print(' *********** ')
print(' * ')
print(' * ')
print(' * ')
tại sao WA giải thích hộ tui
xin hỏi ai theo Đức quốc xã đấy
🤨
ccl
This comment is hidden due to too much negative feedback. Click here to view it.
def is_prime(n):
if n <= 1:
return False
if n <= 3:
return True
if n % 2 == 0 or n % 3 == 0:
return False
i = 5
while i * i <= n:
if n % i == 0 or n % (i + 2) == 0:
return False
i += 6
return True
n = int(input())
if is_prime(n):
print("YES")
else:
print("NO")
[ thu hồi ]
6 more comments