CodeLibrary/07_Clion_Cplus_work_20240601/main.cpp

38 lines
852 B
C++
Raw Normal View History

/*
* Function:
* Date: 2024 06 01
* Code by JRNitre
* */
#include <iostream>
using namespace std;
int main() {
int A = 0;
int B = 0;
int C = 0;
int D = 0;
int E = 0;
int sum_1;
int sum_2;
for (A = 1; A <= 9; A++){
for (B = 1; B <= 9; B++){
for (C = 1; C <= 9; C++){
for (D = 1; D <= 9; D++){
for (E = 1; E <= 9; E++){
sum_1 = A * 1000 + B * 100 + C * 10 + D;
sum_2 = D * 1000 + C * 100 + B * 10 + A;
if (sum_1 * E == sum_2) {
cout << "A: " << A << " - B: " << B << " - C: " << C << " - D: " << D << " - E: " << E << endl;
}
}
}
}
}
}
return 0;
}