Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include<string>
- using namespace std;
- int main() {
- int number, counter = 0;
- cin >> number;
- string print = "No!";
- for (int a = 1; a <= 9; a++) {
- for (int b = 1; b <= 9; b++) {
- for (int c = 1; c <= 9; c++) {
- for (int d = 1; d <= 9; d++) {
- if (a * b + c * d == number && a < b && c > d) {
- cout << a << b << c << d << " ";
- counter++;
- if (counter == 4) {
- print = "Password: " + to_string(a) + to_string(b) + to_string(c) + to_string(d);
- }
- }
- }
- }
- }
- }
- cout << "\n" << print << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement