求救,C++菜鸟的问题

来源:百度知道 编辑:UC知道 时间:2024/05/27 03:22:41
已知一个正整数的个位是6,把个位上的6移到该数的最前面,新数是旧数的4倍,编程求这个数。

#include<stdio.h>
#include<string.h>
#include<math.h>
#include<stdlib.h>
void main()
{
int x;
char str[20];
for(x=1;;x++)
if(6*pow(10,strlen(itoa(x,str,10)))+x==4*(x*10+6))
{
printf("%d",x*10+6);
break;
}
}

正整数十位X 60+X/10X+6=4