标签:iostream sed color while ++ ret 技术分享 pre amp
1 #include <iostream> 2 using namespace std; 3 int main() 4 { 5 bool sushu(int n); 6 long long i,n,s,t,a,b,c,d,e; 7 while (cin>>n) 8 { 9 a=n%10; 10 b=n%100/10; 11 c=n%1000/100; 12 d=n%10000/1000; 13 e=n%100000/10000; 14 if (n>0&&sushu(n)==true) 15 { 16 if (n>1&&n<=9||n==11) cout<<"Yes"<<endl; 17 else if (n>11&&n<100&&n==10) cout<<"No"<<endl; 18 else if (n>=100&&n<1000&&a==c) cout<<"Yes"<<endl; 19 else if (n>=1000&&n<10000&&a==d&&b==c) cout<<"Yes"<<endl; 20 else if (n>=10000&&n<100000&&a==e&&b==d) cout<<"Yes"<<endl; 21 else cout<<"No"<<endl; 22 } 23 else cout<<"No"<<endl; 24 } 25 return 0; 26 } 27 28 bool sushu(int n) 29 { 30 int i,s=0; 31 if (n>1) 32 { 33 for (i=2;i<n;i++) 34 { 35 if (n%i==0) s++; 36 } 37 if (s==0) return true; 38 //else return false; 39 } 40 else return false; 41 }
标签:iostream sed color while ++ ret 技术分享 pre amp
原文地址:http://www.cnblogs.com/domen0814/p/6806464.html