c++中ios有關進制轉換的函數

oct------>八進制
dec------->十進制
hex------>十六進制
控制輸入和輸出的格式:ide

int main()
{
    int a = 0;
    cin >>hex>>a;
    cout << dec<< a;
    system("pause");
    return 0;
}

以十六進制輸入,以十進制輸出。code

相關文章
相關標籤/搜索