HNU 10452 求三个整数中最大的数

求三个整数中最大的数
Time Limit: 1000ms, Special Time Limit:2500ms, Memory Limit:32768KB
Total submit users: 454, Accepted users: 385
Problem 10452 : No special judgement
Problem description
  有三个整数a,b,c,请输出三个整数中最大的数。

Input
  输入每行包含三个整数a,b,c,整数范围在-231  ~  +231-1 之内。

Output
  对于每行三个整数输出其中最大的整数,每组数据输出一行。

Sample Input
2 5 9
8 24 1
Sample Output
9
24

 

#include<iostream>
//#include<stdlib.h>


#define MAX(A,B) ((A)>=(B)?(A):(B))

using namespace std;
int main()
{
    int a,b,c;
    while(cin>>a>>b>>c)
    {
        cout<<MAX((MAX(a,b)),c)<<endl;
    }
    //system("pause");
    return 0;
}

 

posted @ 2013-11-23 16:04  褪色的狼  阅读(155)  评论(0编辑  收藏  举报