1 Star 0 Fork 115

alanlee / CPlusPlusThings

forked from ALONE_WORK / CPlusPlusThings 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
输出格式.cpp 521 Bytes
一键复制 编辑 原始数据 按行查看 历史
light-city 提交于 2020-04-06 00:57 . update
#include<iostream>
#include<iomanip>
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;
system("pause");
return 0;
}
C++
1
https://gitee.com/lzhenya/CPlusPlusThings.git
git@gitee.com:lzhenya/CPlusPlusThings.git
lzhenya
CPlusPlusThings
CPlusPlusThings
master

搜索帮助