1. #include <iostream>  
  2. #include <iomanip>//一定要包含这个c++头文件,非常重要  
  3.   
  4. using namespace std;  
  5.   
  6. int main()  
  7. {  
  8.     int test[4] = { 1, 12, 123, 1234 };  
  9.     for (int i = 0; i < 4; ++i)  
  10.     {  
  11.         cout << setw(4) << setfill('0') << test[i] << " ";  
  12.     }  
  13.     cout << endl << endl;  
  14.     return 0;  

相关文章:

  • 2021-05-25
  • 2021-07-10
  • 2022-12-23
  • 2022-12-23
  • 2022-01-31
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-08
  • 2022-12-23
  • 2022-02-22
  • 2022-12-23
相关资源
相似解决方案