1:代码如下:

#include "stdafx.h"
#include <iostream>
#include <iomanip>
using namespace std;
void main()
{
    int i = 0x2F, j = 255;//0x代表16进制,
    cout << i << endl;//以10进制输出
    cout << hex << i << endl;//以16进制输出
    cout << hex << j << endl;//以16进制输出
    cout << hex << setiosflags(ios::uppercase) << j << endl;//以16进制输出,且字母大写
}
View Code

相关文章:

  • 2021-07-13
  • 2022-12-23
  • 2022-12-23
  • 2021-06-29
  • 2021-12-14
  • 2022-12-23
  • 2021-12-04
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-29
相关资源
相似解决方案