Primary school students fun C ++ programming Lesson 21 Tian Ji horse racing

Primary school students c ++ programming information

Link: https://pan.baidu.com/s/1XlA5AcjDXz5YWOFT32gSmw 
extraction code: 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;
}

  

Guess you like

Origin www.cnblogs.com/kixiaoyuan/p/12694989.html