C++ cout 進制輸出

輸出 16進制:web cout << hex << 100 << endl; 輸出 10進制:svg cout << dec << 100 << endl; 輸出 8進制:spa cout << oct << 100 << endl; 輸出 2進制:code #include <bitset> cout<< bitset<sizeof(int)*8>(十進制變量) <<endl;
相關文章
相關標籤/搜索