体得関数の伝達2

724 ワード

/*
*            :
*Copyright(c)2013,           
*All rights reserved.
*    :
*  :   
*    :2013  12 17 
*   :v1.0
*             :
*    :  
*    :       
*    :...
*    :
*    :
*/
#include <iostream>
using namespace std;
void jiaohuan(int *x, int *y);
int main()
{
    int a,b;
    cin>>a>>b;
    if (a<b)
    jiaohuan(&a, &b);
    cout<<"a,b="<<a<<","<<b;
    return 0;
}
void jiaohuan(int *x, int *y)
{
    int t;
    t=*x;
    *x=*y;
    *y=t;
}