intmain(int argc, char** argv) { std::cout<<"Origin info is: "<<std::endl; std::cout<<"a: "<<argv[1]<<" \tb: "<<argv[2]<<std::endl; mySwap(argv[1],argv[2]); std::cout<<"Has been swaped info is: "<<std::endl; std::cout<<"a: "<<argv[1]<<" \tb: "<<argv[2]<<std::endl;
#include<iostream> voidswap(int &a,int &b) { int temp = a; a= b; b = temp; }
intmain() { int a,b; std::cin>>a>>b; std::cout<<"Original info is "<<std::endl; std::cout<<"a: "<<a<<" b: "<<b<<std::endl; swap(a,b); std::cout<<"Has been swaped info is "<<std::endl; std::cout<<"a: "<<a<<" b: "<<b<<std::endl; return0; }