【UVa】11727 – Cost Cutting

Problem here

Solution

取中間值



#include <iostream> using namespace std; int main(){ int T; while(cin >> T){ for(int i = 1; i <= T; i++){ int a, b, c; cin >> a >> b >> c; cout << "Case " << i << ": " << (a<b?(b<c?b:a<c?c:a):(b>c?b:a>c?c:a)) << endl; } } return 0; } 

你可能感兴趣的:(uva)