Skip to content

Instantly share code, notes, and snippets.

@chenhongqiao

chenhongqiao/golem.cpp Secret

Last active Mar 6, 2021
Embed
What would you like to do?
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
// Read integer n from standard input
cin >> n;
// Process all n pairs of input
for (int i = 0; i < n; i++)
{
// Read integer a and b
int a, b;
cin >> a >> b;
// Print the larger value of a*b and a+b to standard output
cout << max(a + b, a * b) << endl;
}
// Remeber to return 0 at the end of your program
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment