26 lines
466 B
C++
26 lines
466 B
C++
|
#include <iostream>
|
||
|
#include <fstream>
|
||
|
#include <vector>
|
||
|
|
||
|
int main() {
|
||
|
std::vector<int> vector;
|
||
|
std::ifstream input("../input.txt");
|
||
|
|
||
|
std::string line;
|
||
|
|
||
|
while(std::getline(input, line)) {
|
||
|
int num = std::stoi(line);
|
||
|
vector.push_back(num);
|
||
|
}
|
||
|
|
||
|
for (int i : vector) {
|
||
|
for (int j : vector) {
|
||
|
if (i + j == 2020) {
|
||
|
std::cout << (i * j) << std::endl;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return 0;
|
||
|
}
|