UVA 11727 : https://uva.onlinejudge.org/external/117/11727.pdf
/*sort*/
#include <iostream>
#include <stdlib.h>
#include <string.h>
#include <algorithm>
using namespace std;
int main() {
// your code goes here
int count = 0,Case =1;
cin >> count;
while (count--) {
int salary[3];
memset(salary, 0, sizeof(salary));
for (int i = 0; i < 3; i++)
cin >> salary[i];
sort(salary, salary + 3);
cout <<"Case "<<Case<<": "<< salary[1] << endl;
Case++;
}
return 0;
}
/*sort*/
#include <iostream>
#include <stdlib.h>
#include <string.h>
#include <algorithm>
using namespace std;
int main() {
// your code goes here
int count = 0,Case =1;
cin >> count;
while (count--) {
int salary[3];
memset(salary, 0, sizeof(salary));
for (int i = 0; i < 3; i++)
cin >> salary[i];
sort(salary, salary + 3);
cout <<"Case "<<Case<<": "<< salary[1] << endl;
Case++;
}
return 0;
}
留言
張貼留言