64,643
社区成员
发帖
与我相关
我的任务
分享
#include <iostream>
#include <iomanip>
using namespace std;
int main(void)
{
float fa=7.212;
int a=0xf1;
cout<<fa<<endl;
cout<<a<<endl;
cout.setf(ios::scientific);
cout<<fa<<endl;//这里以科学计数法输出
cout.setf(ios::hex);//设置成十六进制
cout<<a<<endl;//这里仍然十进制输出
cout<<hex<<a<<endl;//这里以十六进制输出
system("pause");
return 0;
}