问题:如果一个整数n至少在两个不同进位制b1,b2下都是回文数(2≤b1,b2≤10)则n是双基回文数,注意回文数中不能包含前导0。输入n,n 2 using namespace std; 3 int main() 4 { 5 int i,j,k,flag,count = 0; 6 ...
分类:
其他好文 时间:
2015-12-20 10:26:35
阅读次数:
228
1 #include 2 #include 3 int main() 4 { 5 //1.得到这个数字 2.翻转 3.进行比较 4.如果相同 就输出 是 否则 输出不是 6 7 int resource, result, re_tmp; //resource存放用户输入的数值 ...
分类:
编程语言 时间:
2015-12-19 01:27:42
阅读次数:
164
回文数字,简单处理。将数字各位取出,然后用临时变量累加,当累加完成后这个数字等于原来的数字即是回文数。需要注意的是负数不是回文数。class Solution{public: bool isPalindrome(int x) { if(x 0) { ...
分类:
其他好文 时间:
2015-12-07 20:42:30
阅读次数:
170
题目大意:给定一个整型(即int),判断其是否为回文数首先负数肯定不是回文了,只要判断正数就好。将数字不断%10/10一个个取出来,放到一个数组中。然后再从数组两头开始往中间比较,有不等的马上返回false就好。 public static boolean isPalindrome(int x) {...
分类:
其他好文 时间:
2015-12-04 01:05:42
阅读次数:
162
'; echo '字母a的数量是:',$a_count,''; echo '字母e的数量是:',$e_count,''; echo '字母b的数量是:',$i_count,''; echo '字母o的数量是:',$o_count,''; echo '字母u的数量是:',...
分类:
其他好文 时间:
2015-11-28 15:03:56
阅读次数:
162
#include<stdio.h>
intis_palindromic(intnum)
{
char_old=num;
char_new=0;
while(num)
{
_new=_new*10+(num%10);
num=num/10;
}
if(_new==_old)
{
return1;
}
else
{
return0;
}
}
intmain()
{
intnum=0;
scanf("%d",&num);
intret=is_palindromic(num);
if(ret==1..
分类:
其他好文 时间:
2015-11-13 23:45:15
阅读次数:
315
#includeint main(){ int a, m, sum; scanf("%d", &a); m=a; sum=0; while(m!=0) { sum=sum*10+m%10; ...
分类:
其他好文 时间:
2015-11-11 21:57:48
阅读次数:
163
Determine whether an integer is a palindrome. Do this without extra space.click to show spoilers.Some hints:Could negative integers be palindromes? (i...
分类:
其他好文 时间:
2015-11-09 13:58:52
阅读次数:
256
这题开始想时,感觉给的范围5 2 bool a[9989900]={0}; 3 int pp(int n); 4 int dd[1000];//素数回文数组本来以为会很大,但却很少,可以先打表看看。 5 int main(void) 6 { 7 int n,i,j,k,p,q; 8 ...
分类:
其他好文 时间:
2015-11-01 10:07:12
阅读次数:
213