Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- unsigned char flip(unsigned char ch){
- unsigned char res = 0;
- for(int i = 0; i < 8; i++){
- res |= (ch & 128>>i)>>(7-i);
- cout<<i/*<<' '<<(ch & 128>>i)<<' '<<(7-i)*/<<endl;
- }
- return res;
- }
- int main(void) {
- cout<<(int)flip((char)100)<<endl;
- system("pause");
- return 1;
- }
Add Comment
Please, Sign In to add comment