Skip to content

Instantly share code, notes, and snippets.

@chenhongqiao
Last active March 6, 2021 20:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chenhongqiao/c0fde3f17b9369b855e4e6a63339cd45 to your computer and use it in GitHub Desktop.
Save chenhongqiao/c0fde3f17b9369b855e4e6a63339cd45 to your computer and use it in GitHub Desktop.
#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