码迷,mamicode.com
首页 > 其他好文 > 详细

第一章 作业10

时间:2017-09-12 12:17:30      阅读:165      评论:0      收藏:0      [点我收藏+]

标签:技术分享   作业   第一章   img   alt   names   end   logs   images   

#include<iostream>
using namespace std;

int main()
{
    void sort(int x,int y,int z);
    int x,y,z;
    cin>>x>>y>>z;
    sort(x,y,z);
    return 0;
}
void sort(int x,int y,int z)
{
    int temp;
    if(x>y) {temp=x;x=y;y=temp;}    //{}内3个语句的作用是将X和Y的值互换 
    if(z<x) cout<<z<<,<<x<<,<<y<<endl;
     else if(z<y)cout<<x<<,<<z<<,<<y<<endl;
      else cout<<x<<,<<y<<,<<z<<endl;     
}

技术分享

第一章 作业10

标签:技术分享   作业   第一章   img   alt   names   end   logs   images   

原文地址:http://www.cnblogs.com/aipopo/p/7509149.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!