您的位置:首页 > 其它

第十周项目一程序填充与阅读2

2014-11-02 15:00 281 查看
/* 
 *Copyright (c) 2014, 烟台大学计算机学院 
 * All right reserved. 
 * 文件名称:test.cpp   
 * 作者:赵嵩 
 * 完成时间:2014年11月2号 
 * 版本号:v1.0 
 *
 */ 
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
    int a=34;
    cout<<"hex:"<<hex<<a<<endl;
    cout<<"oct:"<<setbase(8)<<a<<endl;
    cout<<"dec:"<<dec<<a<<endl;
    char *pt="china";
    cout<<setw(10)<<pt<<endl;
    cout<<setfill('*')<<setw(10)<<pt<<endl;
    double d=225.0/7.0;
    cout<<"d="<<setiosflags(ios::fixed)<<d<<endl;
    cout<<setprecision(5)<<d<<endl;
    return 0;
}

运行结果:

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: