Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int n;
- cin >> n;
- for (int i = 1; i < 9; i++) {
- for (int j = 9; j > i; j--) {
- for (int k = 0; k < 9; k++) {
- for (int l = 9; l > k; l--) {
- if ((i + j + k + l) == i * j * k * l && n % 10 == 5) {
- cout << i << j << k << l << endl;
- return 0;
- }
- if (i * j * k * l / (i + j + k + l) == 3 && n % 3 == 0) {
- cout << l << k << j << i << endl;
- return 0;
- }
- }
- }
- }
- }
- cout << "Nothing found\n";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement