.... The science and technology used a long long before ...
1#include <stdio.h>2#include <string.h>3#include <math.h>4#include <iostream>5#include <algorithm>6#include <queue>7#include <vector>8#include <Set>9#include <stack>Ten#include <string> One#include <sstream> A#include <map> -#include <cctype> -#include <limits.h> the using namespacestd; - __int64 Finte (__int64 Integer) - { -__int64 finteger=0; + while(integer!=0) - { +finteger+=integer%Ten; Ainteger=integer/Ten; atfinteger=finteger*Ten; - } -finteger=finteger/Ten; - returnFinteger; - } - BOOLispalindrome (__int64 icandidate) in { - if(icandidate<0)//negative numbers are definitely not palindrome . to return false; + Else - { the if(icandidate<=9)//An integer of length 1 must be a palindrome. * return true; $ ElsePanax Notoginseng { - //Get reversal Value the__int64 isrc=icandidate; +__int64 idst=0; A__int64 ipivot=0; the__int64 ipower=0; + //get the reversal value of Icandidate - while(isrc!=0) $ { $idst=idst*Ten+isrc%Ten; -isrc=isrc/Ten; - } the //compare positive and reverse values; if consistent, it is palindrome; otherwise, it's not a palindrome. - if(idst==icandidate)Wuyi return true; the Else - return false; Wu } - } About } $ intMain () - { -__int64 n,a[10000],flag; - while(SCANF ("%i64d", &n)! =EOF) A { + intmark=flag=0; thea[flag++]=N; - while(!ispalindrome (n)) $ { then=n+Finte (n); thea[flag++]=N; themark++; the } -printf"%i64d\n", Mark); inprintf"%i64d", a[0]); the for(intI=1; i<flag;i++) theprintf"--->%i64d", A[i]); Aboutprintf"\ n"); the } the return 0; the}
The conjecture of palindrome number