UVA 10924 - Prime Words UVA • Sep 1, 2020 Problem PDFSolution:#include #include #include #include #include int main() { int i,l,sum,n,p,j; char c[100]; while(gets(c)) { sum=0; l=strlen(c); for(i=0;i='a'&&c[i]<='z') { n=toascii(c[i])-96; sum=sum+n; } else { n=toascii(c[i])-38; sum=sum+n; } } //printf("%d",sum); p=1; for(j=2; j<=sqrt(sum); j++) { if(sum%j==0) { p=0; break; } } if(p==1 || sum==1) printf("It is a prime word.\n"); else if(p==0) printf("It is not a prime word.\n"); } return 0; } https://github.com/Shipu/OnlineJudgeProblemSolutionWithCPlusPlus/tree/master/uva/10924/10924.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