不知道这样行不?
#include <iostream.h>
int main()
{
int a,b,c;
cout << \"请输入a \" << endl;
cin >> a ;
cout << \"请输入b \" << endl;
cin >> b;
cout << \"请输入c\" << endl;
cin >> c;
if ( a > b )
{
if( a > c)
{
if( b > c)
{
cout << \"a=\" << a << \">\" << \"b=\" << b << \">\" << \"c=\" << c << endl;
}
else
{
cout << \"a=\" << a << \">\" << \"c=\" << c << \">\" << \"b=\" << b << endl;
}
}
else
{
cout << \"c=\" << c << \">\" << \"a=\" << a << \">\" << \"b=\" << b << endl;
}
}
else
{
if ( a > c)
{
cout << \"b=\" << b << \">\" << \"a=\" << a << \">\" << \"c=\" << c << endl;
}
else
{
if( b > c)
{
cout << \"b=\" << b << \">\" << \"c=\" << c << \">\" << \"a=\" << a << endl;
}
else
{
cout << \"c=\" << c << \">\" << \"b=\" << b << \">\" << \"a=\" << a << endl;
}
}
}
}
[此贴子已经被作者于2007-6-9 19:11:44编辑过]
代码如下:
用<map>容器来做的~~
不过有很多WARING,不知道为什么~~~
#include<iostream>
#include<map>
using namespace std;
typedef map<int ,char > mymap;
void main()
{
int num1,num2,num3;
int i=0;
cout<<"输入a=";
cin>>num1;
cout<<"输入b=";
cin>>num2;
cout<<"输入c=";
cin>>num3;
mymap abc;
mymap :: reverse_iterator it;
abc.insert( mymap::value_type (num1,'a') );
abc.insert( mymap::value_type (num2,'b') );
abc.insert( mymap::value_type (num3,'c') );
for (it=abc.rbegin(); it!=abc.rend(); it++,i++)
{
cout<<it->second<<"=";
cout<<it->first;
if ( i!=2)
{
cout<<" > ";
}
}
cout<<endl;
}