#include <iostream> using namespace std; int main () { int a = 3; int b = 5; cout<<"a="<<a<<",b="<<b<<endl; a = a+b; ///a=7 b = a-b; ///b=3; a = a-b; ///a=5 cout<<"a="<<a<<",b="<<b<<endl; return 0; }
输出:
a=3,b=5
a=5,b=3
时间: 2024-10-14 14:01:54
#include <iostream> using namespace std; int main () { int a = 3; int b = 5; cout<<"a="<<a<<",b="<<b<<endl; a = a+b; ///a=7 b = a-b; ///b=3; a = a-b; ///a=5 cout<<"a="<<a<<",b="<<b<<endl; return 0; }
输出:
a=3,b=5
a=5,b=3