Gửi bài giải
Điểm:
1,00 (OI)
Giới hạn thời gian:
1.0s
Giới hạn bộ nhớ:
256M
Input:
NGUYENTO.inp
Output:
NGUYENTO.out
Dạng bài
Ngôn ngữ cho phép
C++, Pascal, Python
Bình luận
include<bits/stdc++.h>
define ll long long
using namespace std; bool nt(ll n) { for(long i=2;i<=sqrt(n);i++) { if(n%i==0) return false; } return n>1; } ll n; int main() { iosbase::syncwith_stdio(0);cin.tie();cout.tie(); freopen("NGUYENTO.inp","r",stdin); freopen("NGUYENTO.out","w",stdout); cin>>n; ll b=trunc(sqrt(n)); if(nt(b)==true&&bb==n) cout<<n; else { while(b++) { if(nt(b)==true) { cout<<bb; break; } } } }