SHARE
TWEET

Untitled

a guest Nov 13th, 2019 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<iostream>
  2. using namespace std;
  3.  
  4. int main(){
  5.     int a = 32766;
  6.     int b = 10383;
  7.     int c = a;
  8.     int d = 0;
  9.     int checker = 1;
  10.     while(b!=0){
  11.         if(checker == (b & checker)){
  12.             int i = 1;
  13.             while(i!=checker){
  14.                 c = c + c;
  15.                 i = i + i;
  16.             }
  17. //          for(int i = 1; i < checker; i=i+i){
  18. //              c = c + c;
  19. //          }
  20.             d = d + c;
  21.             c = a;
  22.             b = b - checker;
  23.             checker = 1;
  24.         }else{
  25.             checker = checker + checker;
  26.         }
  27.         cout << b << "   ,   " << checker << endl;
  28.  
  29.     }
  30.     cout << "result : " << d;
  31. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top