#include <iostream>
#include <vector>
int main() {
// Define a vector to store the 6 numbers
std::vector<int> numbers(6);
// Prompt the user to enter the numbers
std::cout << "Enter 6 numbers:\n";
for (int i = 0; i < 6; ++i) {
std::cin >> numbers[i];
}
// Initialize maxProduct to the product of the first two numbers
int maxProduct = numbers[0] * numbers[1];
// Iterate through pairs of numbers and update maxProduct if a larger product is found
for (int i = 0; i < 5; ++i) {
for (int j = i + 1; j < 6; ++j) {
int product = numbers[i] * numbers[j];
if (product > maxProduct) {
maxProduct = product;
}
}
}
// Output the largest product
std::cout << "The largest product of pairs is: " << maxProduct << std::endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dmVjdG9yPgoKaW50IG1haW4oKSB7CiAgICAvLyBEZWZpbmUgYSB2ZWN0b3IgdG8gc3RvcmUgdGhlIDYgbnVtYmVycwogICAgc3RkOjp2ZWN0b3I8aW50PiBudW1iZXJzKDYpOwoKICAgIC8vIFByb21wdCB0aGUgdXNlciB0byBlbnRlciB0aGUgbnVtYmVycwogICAgc3RkOjpjb3V0IDw8ICJFbnRlciA2IG51bWJlcnM6XG4iOwogICAgZm9yIChpbnQgaSA9IDA7IGkgPCA2OyArK2kpIHsKICAgICAgICBzdGQ6OmNpbiA+PiBudW1iZXJzW2ldOwogICAgfQoKICAgIC8vIEluaXRpYWxpemUgbWF4UHJvZHVjdCB0byB0aGUgcHJvZHVjdCBvZiB0aGUgZmlyc3QgdHdvIG51bWJlcnMKICAgIGludCBtYXhQcm9kdWN0ID0gbnVtYmVyc1swXSAqIG51bWJlcnNbMV07CgogICAgLy8gSXRlcmF0ZSB0aHJvdWdoIHBhaXJzIG9mIG51bWJlcnMgYW5kIHVwZGF0ZSBtYXhQcm9kdWN0IGlmIGEgbGFyZ2VyIHByb2R1Y3QgaXMgZm91bmQKICAgIGZvciAoaW50IGkgPSAwOyBpIDwgNTsgKytpKSB7CiAgICAgICAgZm9yIChpbnQgaiA9IGkgKyAxOyBqIDwgNjsg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