?? ch2_1.cpp
字號(hào):
//*********************
//** ch2_1.cpp **
//*********************
#include <iostream.h>
#include <iomanip.h> //要用到格式控制符
void main()
{
double amount = 22.0/7;
cout <<amount <<endl;
cout <<setprecision(0) <<amount <<endl
<<setprecision(1) <<amount <<endl
<<setprecision(2) <<amount <<endl
<<setprecision(3) <<amount <<endl
<<setprecision(4) <<amount <<endl;
cout <<setiosflags(ios::fixed);
cout <<setprecision(8) <<amount <<endl;
cout <<setiosflags(ios::scientific) <<amount <<endl;
cout <<setprecision(6); //重新設(shè)置成原默認(rèn)設(shè)置
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -