提交时间:2024-01-24 17:00:47

运行 ID: 126730

# include <iostream> using namespace std ; bool isp ( long long x ) { if ( x < 2 ) { return false ; } if ( x == 2 ) { return true ; } for ( long long i = 2 ; i * i <= x ; i ++ ) { if ( x % i == 0 ) { return false ; } } return true ; } int main ( ) { long long n ; cin >> n ; if ( isp ( n ) ) { cout << "Yes" << endl ; } else { cout << "No" << endl ; } return 0 ; }