运用swap函数实现两个数交换
#include
using namespace std;
void Swap(int *x,int *y){
int temp= *x;
*x= *y;
*y=temp;
}
int main(){
int a,b;
cin>>a>>b;
Swap(&a,&b);
cout&lt;<a>&lt;&lt;&quot; &quot;&lt;</a>
#include
using namespace std;
void Swap(int *x,int *y){
int temp= *x;
*x= *y;
*y=temp;
}
int main(){
int a,b;
cin&gt;&gt;a&gt;&gt;b;
Swap(&amp;a,&amp;b);
cout&lt;<a>&lt;&lt;&quot; &quot;&lt;</a>
全部评论
相关推荐
华灯初上i:给一个问题: 你觉得langchain写agent有什么优势嘛,使用过程中遇到了什么问题,怎么解决的。框架的取消机制如何实现的(推理取消和工具调用取消)。
点赞 评论 收藏
分享
点赞 评论 收藏
分享
查看7道真题和解析