青岛农业大学理学与信息科学学院面向对象程序设计课件 第七章.pptVIP

  • 0
  • 0
  • 约1.82千字
  • 约 12页
  • 2019-05-13 发布于广东
  • 举报

青岛农业大学理学与信息科学学院面向对象程序设计课件 第七章.ppt

第七章 输入输出流 基本输入输出方式 cin /cout cin :输入数据流( istream)对象 cout:输出数据流(ostream)对象 输入/输出流的继承关系 格式控制输入输出 状态标志:x_flags 成员函数 例 #include iostream #include iomanip using namespace std; int main() { cout1234endl; cout12345endl; cout123456endl; coutsetw(8)1234endl; coutsetw(8)12345endl; coutsetw(8)123456endl; return 0; } 格式控制输入输出 ——成员函数 width()、width(int wid) fill()、fill(char c) precision()、precision(int p) 格式控制输入输出 width()、width(int wid) fill()、fill(char c) precision()、precision(int p) 例 #include iostream #include iomanip using namespace std; int main() { cout1234endl; cout12345endl; cou

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档