题解 | #编写函数实现两数交换(指针方式)#

编写函数实现两数交换(指针方式)

https://www.nowcoder.com/practice/380c764bdef64ad696cdfa90bfe85156

#include <iostream>
using namespace std;

// write your code here......


int main() {
    void swap(int &m,int &n);
    int m, n;
    cin >> m;
    cin >> n;

    // write your code here......
    swap(m,n);

    cout << m << " " << n << endl;

    return 0;
}
void swap(int &m,int &n){
    int temp;
    temp=m;m=n;n=temp;    
}

全部评论

相关推荐

故事和酒66:小米现在校招很多都是在高校搞小米训练营,然后直接挑人,大四就去实习,所以实际上校招总名额是变少了的。同学211本无经验经过两周培训直接签了
秋招,不懂就问
点赞 评论 收藏
分享
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务