# re: 利用google在线翻译制作自己的翻译程序之ruby版 回复 更多评论
2008-07-09 14:43 by
#include<stdio.h>
#define MAX 2147483647
long re(long int);
int nonres(long int s);
void main()
{
long int n,m;
int count=0;
printf("Please enetr a number optionaly:");
scanf("%ld",&n);
printf("The generation process of palindrome:\n");
while(!nonres((m=re(n))+n))
{
if(m+n>=MAX)
{
printf(" input error,break.\n");
break;
}
else
{
printf("[%d]:%ld+%ld=%ld\n",++count,n,m,m+n);
n+=m;
}
}
printf("[%d]:%ld+%ld=%ld\n",++count,n,m,m+n);
printf("Here we reached the aim at last!\n");
}
long re(long int a)
{
long int t;
for(t=0;a>0;a/=10)
t=t*10+a%10;
return t;
}
int nonres(long int s)
{
if(re(s)==s) return 1;
else return 0;
}
# re: 利用google在线翻译制作自己的翻译程序之ruby版 回复 更多评论
2008-08-11 15:14 by
从33个数中选6个数的排列,要全部显示出来的.但不能重复.