Guest User

Untitled

a guest
Feb 24th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. unsigned char flip(unsigned char ch){
  6. unsigned char res = 0;
  7. for(int i = 0; i < 8; i++){
  8. res |= (ch & 128>>i)>>(7-i);
  9. cout<<i/*<<' '<<(ch & 128>>i)<<' '<<(7-i)*/<<endl;
  10. }
  11. return res;
  12. }
  13.  
  14. int main(void) {
  15. cout<<(int)flip((char)100)<<endl;
  16.  
  17. system("pause");
  18. return 1;
  19. }
Add Comment
Please, Sign In to add comment