1 条题解

  • 0
    @ 2023-12-29 15:17:02
    //可以通过传引用的方式,将改变以后的值返回到主函数之中
    #include<bits/stdc++.h>
    using namespace std;
    void change(int &x,int &y)
    {
    	int t=x;
    	x=y;
    	y=t;
    }
    int main()
    {
    	int a,b;
    	cin>>a>>b;
    	change(a,b);
    	cout<<a<<" "<<b;
    	return 0;
    }
    
    • 1

    信息

    ID
    1619
    时间
    1000ms
    内存
    256MiB
    难度
    9
    标签
    (无)
    递交数
    9
    已通过
    5
    上传者