zoukankan      html  css  js  c++  java
  • C++ 基本的输入输出

    C++ 基本的输入输出
    C++ 标准库提供了一组丰富的输入/输出功能,我们将在后续的章节进行介绍。本章将讨论 C++ 编程中最基本和最常见的 I/O 操作。

    C++ 的 I/O 发生在流中,流是字节序列。如果字节流是从设备(如键盘、磁盘驱动器、网络连接等)流向内存,这叫做输入操作。如果字节流是从内存流向设备(如显示屏、打印机、磁盘驱动器、网络连接等),这叫做输出操作。

     1 #include <iostream>
     2 
     3 /* run this program using the console pauser or add your own getch, system("pause") or input loop */
     4 using namespace std;
     5 int main(int argc, char** argv) {
     6     int max(int a,int b,int c=0);
     7     int a,b,c;
     8     cin >>a >>b >>c;
     9     cout <<"max(a,b,c)="<<max(a,b,c)<<endl;
    10     cout <<"max(a,b)="<<max(a,b)<<endl;
    11     return 0;
    12 }
    13 
    14 int max(int a,int b,int c)
    15 {
    16     if(b>a)a=b;
    17     if(c>a)a=c;
    18     return a;
    19 }
  • 相关阅读:
    ui5 call view or method from another view
    vuejs helloworld
    vuejs v-model
    vuejs v-bind
    vuejs on
    vuejs fatherandson
    vuejs scope
    vuejs keep-alive
    VLAN虚拟局域网
    网线的制作
  • 原文地址:https://www.cnblogs.com/borter/p/9401084.html
Copyright © 2011-2022 走看看