编程输出三个数中的最大值

#include <iostream>
using namespace std;
int main()
{
	int a,b,c,d;
	cin>>a>>b>>c;
	if(a>b) d=a;
	else if(b>c)d=b;
	else d=c;
	if(a>c)d=a;
	else if(b>c)d=b;
	else d=c;
	cout<<"max="<<d<<endl;
	return 0;
}


 

posted @ 2012-10-22 16:09  同学少年  阅读(477)  评论(0编辑  收藏  举报