用c++编程设abcd*e=dcba(a非0,e非0非1),求满足条件的abcd和e
时间: 2024-04-30 16:23:07 浏览: 140
一个c++程序
```c
#include <stdio.h>
int main() {
int a, b, c, d, e;
for (a = 1; a <= 9; a++) {
for (b = 0; b <= 9; b++) {
for (c = 0; c <= 9; c++) {
for (d = 0; d <= 9; d++) {
for (e = 2; e <= 9; e++) {
if (a * 1000 + b * 100 + c * 10 + d
== d * 1000 + c * 100 + b * 10 + a
&& a * e == d * 10 + c) {
printf("%d%d%d%d*%d=%d%d%d%d\n", a, b, c, d, e, d, c, b, a);
}
}
}
}
}
}
return 0;
}
```
阅读全文