#include<bits/stdc++.h>
using namespace std ;
const int maxn = 1e5 + 10 ;
const int inf = 0x3f3f3f3f ;
int judge(int x){
if(x == 2) return 1 ;
if(x == 1) return 0 ;
for(int i = 2 ; i < sqrt(x)+1 ; i++){
if(x % i == 0){
return 0 ;
}
}
return 1 ;
}
void deal(){
string s ; cin >> s ;
int n = s.size() , cnt = 0 ;
for(int i = 0 ; i < n ; i++){
cout << s ;
int x = atoi(s.c_str()) ;
if(judge(x)) cnt++ , cout << " Yes\n" ;
else cout << " No\n" ;
s = s.substr(1) ;
}
if(cnt == n)cout << "All Prime!\n" ;
}
int main(){
deal() ;
return 0 ;
}
pat甲级1168 Prime Day 质数日
最新推荐文章于 2024-08-13 23:31:35 发布