标签:io os sp as c++ ios c return class
#include<iostream> using namespace std; int main() { int a,b,c; cout<<"请输入三个数"<<endl; cin>>a>>b>>c; if(a>b) { if(a>c) { if(b>c) { cout<<"三个数的从小到大的排序为"<<endl; cout<<a<<" "<<b<<" "<<c<<endl; } else { int tmp=a; b=c;c=tmp; cout<<"三个数的从小到大的排序为"<<endl; cout<<a<<" "<<b<<" "<<c<<endl; } } else { int tmp1,tmp2; tmp1=a; tmp2=b; a=c; b=tmp1; c=tmp2; cout<<"三个数的从小到大的排序为"<<endl; cout<<a<<" "<<b<<" "<<c<<endl; } } else { if(b>c) { if(a>c) { int tmp1=a; int tmp2=b; a=b; b=tmp1; cout<<"三个数的从小到大的排序为"<<endl; cout<<a<<" "<<b<<" "<<c<<endl; } else { int tmp1=a; int tmp2=b; a=b; b=c; c=tmp1; cout<<"三个数的从小到大的排序为"<<endl; cout<<a<<" "<<b<<" "<<c<<endl; } } else { int tmp1=a; int tmp2=b; a=c; c=tmp1; cout<<"三个数的从小到大的排序为"<<endl; cout<<a<<" "<<b<<" "<<c<<endl; } } system("pause"); return 0; }
标签:io os sp as c++ ios c return class
原文地址:http://blog.csdn.net/qq_22335577/article/details/40986143