mirror of
https://github.com/wczffl-503/OI-Codes.git
synced 2025-07-07 18:06:58 +08:00
Update: Rename folder name to XSMOJ
This commit is contained in:
20
XSMOJ/位运算符.cpp
Normal file
20
XSMOJ/位运算符.cpp
Normal file
@ -0,0 +1,20 @@
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
#include <cmath>
|
||||
#include <cstdio>
|
||||
using namespace std;
|
||||
int main(){
|
||||
int a,b,c,d,e,f,g,h;
|
||||
cin >>a>>b;
|
||||
c=a&b;
|
||||
d=a|b;
|
||||
e=a^b;
|
||||
f=~a;
|
||||
cout <<"a&b="<<c<<endl;
|
||||
cout <<"a|b="<<d<<endl;
|
||||
cout <<"a^b="<<e<<endl;
|
||||
cout <<"~a="<<f<<endl;
|
||||
cout <<"a<<b="<<(a<<b)<<endl;
|
||||
cout <<"a>>b="<<(a>>b)<<endl;
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user