A,B,C,D,E,F是1到9之间得到任何数,ABCDEF*2=CDEFAB,CDEFAB*2=EFABCD,ABCDEF这六位数是什么
问题描述:
A,B,C,D,E,F是1到9之间得到任何数,ABCDEF*2=CDEFAB,CDEFAB*2=EFABCD,ABCDEF这六位数是什么
答
a = 1,b = 4,c = 2,d = 8,e = 5,f = 7
C代码:
# include
//根据题意确定循环上下限
int max = 1000000;
int min = 1000000 / 2 / 2;
int ABCDEF;
int CDEFAB;
int EFABCD;
int main(int argc,char **argv)
{
for (ABCDEF = 100000; ABCDEF {
int A = ABCDEF / 100000;
int B = (ABCDEF % 100000) / 10000;
int C = (ABCDEF % 10000) / 1000;
int D = (ABCDEF % 1000) / 100;
int E = (ABCDEF % 100) / 10;
int F = (ABCDEF % 10);
if (C 啊!牛大哥,厉害