Skip to content

Instantly share code, notes, and snippets.

@fa7ad
Created March 4, 2016 11:43
Show Gist options
  • Save fa7ad/8491c04e9800b7ab2471 to your computer and use it in GitHub Desktop.
Save fa7ad/8491c04e9800b7ab2471 to your computer and use it in GitHub Desktop.
#include <iostream>
#include <algorithm>
void clearIO()
{
int ch;
while ((ch = std::cin.get()) != std::cin.eof() && ch != '\n');
}
int main(int argc, char* argv[])
{
int cn;
std::cin >> cn;
cn = abs(cn);
if (cn <= 100) {
int inps[cn][3];
clearIO();
for (int i = 0; i < cn; i++) {
std::cin >> inps[i][0] >> inps[i][1] >> inps[i][2];
clearIO();
}
for (int d = 0; d < cn; d++) {
std::sort(inps[d], inps[d] + 3, std::greater<int>());
std::cout << "Case " << d + 1 << ": " << inps[d][0] << std::endl;
}
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment