UVA 10235 - Simply Emirp UVA • Aug 31, 2020 Problem PDFSolution:#include #include #include int main() { long long i,c,d,num,j,p,n; while(scanf("%lld",&num)==1) { p=num; i=2; while(i<=num) { if(num%i==0) break; i++; } n=0; while(num!=0) { n=n*10+num%10; num/=10; } j=2; while(j<=n) { if(n%j==0) break; j++; } if(p==2) printf("%lld is prime.\n",p); else if((j==n)&&(i==p)) printf("%lld is erime.\n",p); else if(i==p) printf("%lld is prime.\n",p); else printf("%lld is not prime.\n",p); } return 0; } https://github.com/Shipu/OnlineJudgeProblemSolutionWithCPlusPlus/tree/master/uva/10235/10235.cpp Tags UVA Competitive Programming Shipu Ahamed Recommended for you UVA UVA 913 - Joana and the Odd Numbers 4 years ago • 1 min read UVA UVA 871 - Counting Cells in a Blob 4 years ago • 3 min read UVA UVA 866 - Intersecting Line Segments 4 years ago • 3 min read