Advertisement
tobast

Untitled

Mar 29th, 2013
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.21 KB | None | 0 0
  1. #include <vector>
  2. using namespace std;
  3.  
  4. int main(void)
  5. {
  6.     vector<bool> tab;
  7.     // ...
  8.    
  9.     int somme = 0;
  10.     for(size_t pos=0; pos < tab.size(); pos++)
  11.     {
  12.         somme <<= 1;
  13.         somme += tab[pos];
  14.     }
  15.    
  16.     // ...
  17.  
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement