满意答案
huahanxx
2013.06.06
采纳率:43% 等级:12
已帮助:7545人
改成c语言了,再试试:
#include
#include
using namespace std;
void main()
{
int num,temp1,temp2,count1=0,count2=0;
vectortest;
for(num=10;num<=10000;num++) //找10-10000的回文数
{
if(num<100)
{
temp1=num%10;
temp2=num/10;
if(temp1==temp2)
{
//cout<
printf("%d ",num);
count1++;
if(count1>=10)//十个一行输出
{
printf("\n");
count1=0;
}
}
if(num==99)
printf("\n");
}
else{
temp1=num%10;
temp2=num/100;
if(temp1==temp2)
{
printf("%d ",num);
count2++;
if(count2>=10)
{
printf("\n");
count2=0;
}
}
}
}
}
00分享举报