support bazel complie this project and format code.

This commit is contained in:
zhangxing
2023-03-30 00:15:11 +08:00
committed by light-city
parent 1f86192576
commit 3c8a3f259b
641 changed files with 10349 additions and 9523 deletions

View File

@@ -0,0 +1,19 @@
/* 输出格式.cpp */
#include <iomanip>
#include <iostream>
using namespace std;
int main(int argc, char const *argv[]) {
char s[20] = "this is a string";
double digit = -36.96656;
cout << setw(30) << left << setfill('*') << s << endl;
cout << dec << setprecision(4) << digit << endl;
cout << dec << 15 << endl;
// setbase(int x)设置进制后,后面所有操作都是按照这个进制来计算!
cout << setbase(10) << 15 << endl;
//四舍五入,并保留2位有效数组
float x = 6.6937;
cout << float(int(x * 1000 + 0.5) / 1000.0) << endl;
return 0;
}