欧美大屁股bbbbxxxx,狼人大香伊蕉国产www亚洲,男ji大巴进入女人的视频小说,男人把ji大巴放进女人免费视频,免费情侣作爱视频

歡迎來到入門教程網(wǎng)!

C語言

當(dāng)前位置:主頁 > 軟件編程 > C語言 >

C++ 如何用cout輸出hex,oct,dec的解決方法

來源:本站原創(chuàng)|時(shí)間:2020-01-10|欄目:C語言|點(diǎn)擊: 次

HEX:

復(fù)制代碼 代碼如下:

#include <iostream.h>
#include <iomanip.H>
main(void)
{
       long n = 10000;
       cout << hex << n ;
       return 0;
}

OCT:
復(fù)制代碼 代碼如下:

#include <iostream.h>
#include <iomanip.H>
main(void)
{
       long n = 10000;
       cout << oct << n ;
       return 0;
}

DEC:
復(fù)制代碼 代碼如下:

#include <iostream.h>
#include <iomanip.H>
main(void)
{
       long n = 10000;
       cout << dec << n << endl;
       return 0;
}

復(fù)制代碼 代碼如下:

#include <iostream>
using namespace std;

int main()
{
  cout.setf(ios::hex, ios::basefield);

  cout << 100; // this displays 64

  return 0;
}

復(fù)制代碼 代碼如下:

#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
   int n;
   cout << "Enter a decimal number: ";
   cin >> n;
   cout << n << " in hexadecimal is: "
        << hex << n << '/n'
        << dec << n << " in octal is: "
        << oct << n << '/n'
        << setbase( 10 ) << n << " in decimal is: "
        << n << endl;
   return 0;
}

上一篇:C# interface與delegate效能比較的深入解析

欄    目:C語言

下一篇:C語言關(guān)鍵字auto與register的深入理解

本文標(biāo)題:C++ 如何用cout輸出hex,oct,dec的解決方法

本文地址:http://mengdiqiu.com.cn/a1/Cyuyan/4361.html

網(wǎng)頁制作CMS教程網(wǎng)絡(luò)編程軟件編程腳本語言數(shù)據(jù)庫服務(wù)器

如果侵犯了您的權(quán)利,請與我們聯(lián)系,我們將在24小時(shí)內(nèi)進(jìn)行處理、任何非本站因素導(dǎo)致的法律后果,本站均不負(fù)任何責(zé)任。

聯(lián)系QQ:835971066 | 郵箱:835971066#qq.com(#換成@)

Copyright © 2002-2020 腳本教程網(wǎng) 版權(quán)所有