小学生趣味C++编程第21课 田忌赛马

小学生c++编程资料

链接:https://pan.baidu.com/s/1XlA5AcjDXz5YWOFT32gSmw 
提取码:9iz9 

#include<iostream>
using namespace std;
int main()
{
  float a,b,c,temp;
  cout<<"a,b,c=";
  cin>>a>>b>>c;
  if(a>b)
  {
    temp=a;        
  	a=b;
  	b=temp;
  }
  if(a>c)
  {
  	temp=a;
  	a=c;
  	c=temp; 
  }
  if(b>c) 
  {
  	temp=b;
  	b=c;
  	c=temp; 
  }
  cout<<a<<' '<<b<<' '<<c<<endl;	//' '中间有一个空格
  return  0;
}

  

猜你喜欢

转载自www.cnblogs.com/kixiaoyuan/p/12694989.html
今日推荐