#include<bits/stdc++.h> using namespace std; bool f(int x){ if(x<2) return 0; for(int i=2;i<=sqrt(x);i++) if(x%i0) return 0; return 1; } bool g(int x){ int ans=0; int tep=x; while(x);{ ans=ans*10+x%10; x/=10; } if(tepans) return 1; return 0; } int main(){ int n; cin>>n; if(f(n)&&g(n)) cout<<"prime"; else cout<<"not prime"; }

0 条评论

目前还没有评论...