控制位數和填充0

若是是C語言那麼用ios printf("%05d", a); 若是是C++ #include <iostream> #include <iomanip> //包括這個頭文件 using namespace std; void main() { int a = 33; cout<<setw(5)<<setfill('0')<<a; 用這兩個函數 }函數 C++ 標準輸出如何控制小數點後位數 #in
相關文章
相關標籤/搜索