#include < stdio.h >#include < conio.h >int main(){int num,ntmp,tmp;scanf("%d",&num);tmp=0;ntmp=num;while(ntmp){tmp=tmp|(ntmp&1);ntmp=ntmp >> 1;tmp=tmp << 1;printf("%d %d\n",ntmp,tmp);}tmp=tmp >> 1;if(tmp==num)printf("palindrome\n");elseprintf("not a palindrome\n");getch();return 0;}
#include < stdio.h >
ReplyDelete#include < conio.h >
int main()
{
int num,ntmp,tmp;
scanf("%d",&num);
tmp=0;
ntmp=num;
while(ntmp)
{
tmp=tmp|(ntmp&1);
ntmp=ntmp >> 1;
tmp=tmp << 1;
printf("%d %d\n",ntmp,tmp);
}
tmp=tmp >> 1;
if(tmp==num)
printf("palindrome\n");
else
printf("not a palindrome\n");
getch();
return 0;
}