>>648
16桁の2進数を入力して、10進数に変換して出力するプログラム

#include <iostream>
#include <bitset>
int main()
{
 std::bitset< 16 > bits;
 if( std::cin >> bits )
  std::cout << bits.to_ulong();
}