第十四周阅读程序一
2015-06-10 09:06
423 查看
问题
#include <iostream> using namespace std; int main() { int a=21; cout.setf(ios::showbase); cout<<"dec:"<<a<<endl; cout.unsetf(ios::dec); cout.setf(ios::hex); cout<<"hex:"<<a<<endl; cout.unsetf(ios::hex); cout.setf(ios::oct); cout<<"oct:"<<a<<endl; char *pt="China"; cout.width(10); cout<<pt<<endl; cout.width(10); cout.fill('*'); cout<<pt<<endl; double pi=22.0/7.0; cout.setf(ios::scientific); cout<<"pi="; cout.width(14); cout<<pi<<endl; cout.unsetf(ios::scientific); cout.setf(ios::fixed); cout.width(12); cout.setf(ios::showpos); cout.setf(ios::internal); cout.precision(6); cout<<pi<<endl; return 0; }
相关文章推荐
- 下载一个网站的html并保存到文件中
- CentOS6.6强行破解root密码
- 按行读取数据
- 第十四周上机项目三OOP版电子词典
- Scientific Toolworks Understand for linux
- SQL SERVER查看数据库备份信息
- Android NDK 引用第三方.so库到lib下
- left join on 和where条件的放置
- 那些在学习iOS开发前就应该知道的事
- 第十四周项目4 - 处理C++源代码的程序(m后n行加注释)
- 第十三周 课后实践:项目一——动物这样叫(1)
- 第14周 项目一-小玩文件(2)
- 第十五周阅读程序(2)
- 「Offer Sword」Interview 36:数组中的逆序对
- 第13周-阅读项目4-写出下面程序的输出结果
- Hibernate框架中的HibernateUtil
- 日期字符串解析--SimpleDateFormat严格限制日期转换setLenient(false)
- To_10_r_100_4---在二元数中找出某一值的所有路径
- 简单的hello word程序在计算机系统中是如何运行的
- Objective-C Autorelease Pool 的实现原理