C++入門經典-例2.10-控制輸出精確度

1:代碼如下: // 2.10.cpp : 定義控制檯應用程序的入口點。 // #include "stdafx.h" #include <iostream> using namespace std; void main() { int x=123; double y=-3.1415; cout << "x="; cout.width(10);//輸出字符串的寬度
相關文章
相關標籤/搜索