生活随笔
收集整理的這篇文章主要介紹了
c++异或运算
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
#include<iostream>
#include<stdio.h>
#include<string>
using namespace std;
int main()
{int a = 18;int b = 10;cout << "----------------------" << endl;cout << "| 轉換前a=" << a << " |"<< endl;cout << " 轉換前b=" << b << " | " << endl;cout << "------------------------" << endl;a = a^b;b = a^b;a = b^a;cout << "----------------------" << endl;cout << "| 轉換后a=" << a << " |" << endl;cout << " 轉換后b=" << b << " | " << endl;cout << "------------------------" << endl;system("pause");return 0;
}
總結
以上是生活随笔為你收集整理的c++异或运算的全部內容,希望文章能夠幫你解決所遇到的問題。
如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。