#include<iostream>
using namespace std;
void swap(int *p1,int *p2)
{
    int temp;
    temp=*p1;
    *p1=*p2;
    *p2=temp;
}
int main()
{
    int a,b;
    cin>>a>>b;
    if(a>b)
    {
        swap(&a,&b);
    }
    cout<<"从小到大输出"<<endl;
    cout<<a<<' '<<b<<endl;
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: