/*Name: NYOJ--811--变态最大值Author: shen_渊 Date: 17/04/17 15:49Description: 看到博客上这道题浏览量最高,原来的代码就看不下去了 o(╯□╰)o
*/#include
#include
#include
using namespace std;
struct group{int first,second,third;int max_value;//三个数中的最大值 bool operator<(const group &a)const{return max_value>a.max_value;}
}num[4000];
int main()
{int n,i,j;while(cin>>n){memset(num,0,sizeof(num));i = n/3;for(j=0; j>num[j].first>>num[j].second>>num[j].third;if((j+1)%2){num[j].max_value = (num[j].max_value = num[j].first>num[j].second?num[i].first:num[j].second)>num[j].third?num[j].max_value:num[j].third;}else{num[j].max_value = (num[j].max_value = num[j].first>num[j].second?num[j].second:num[j].first)>num[j].third?num[j].third:num[j].max_value;}}sort(num,num+i);cout<
/*Name: NYOJ--811--变态最大值 Author: shen_渊 Date: 17/04/17 16:12Description: 整理了一下以前的代码
*/
#include
#include
int smax(int a,int b,int c){int max;max = (max = a>b?a:b)>c?max:c;return max;
}
int smin(int a,int b,int c){int max;max = (max = a