5.8打卡

#include <bits/stdc++.h>
using namespace std;
void swap(int &a,int &b)
    {
        int t=a;
        a=b;
        b=t;
    }
int main()
{
    int x=5,y=10;
    cout<<"x="<<x<<"  y="<<y<<endl;
    swap(x,y);
    cout<<"x="<<x<<"  y="<<y<<endl; 
    return 0;
}

 

posted @ 2023-05-08 16:15  记得关月亮  阅读(12)  评论(0)    收藏  举报