Created
November 12, 2016 04:38
-
-
Save FloydHsiu/cb700843c6798f50fc5aef04ed225b61 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sum=input; | |
for(count=1;count<=10;count++)//反向相加的次數以10為上限(這裡開始好像怪怪的) | |
{ | |
reverse = 0; | |
temp=sum; | |
while(temp) | |
{ | |
reverse=reverse*10+temp%10; | |
temp/=10; | |
} | |
sum = sum + reverse; | |
if(ispalindromic(sum)){ | |
break; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment