• 逻揖上密切相关的语句之间不加空行


    在一个函数体内,逻揖上密切相关的语句之间不加空行,其它地方应 加空行分隔。

     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 //max()为内联函数
     6 inline int max(int x,int y)   //注意inline关键字
     7 {
     8     return x>y?x:y;
     9 }
    10 
    11 //定义main()函数 
    12 
    13 int main(int argc, char** argv) {
    14     
    15     int a=3,b=5,c;
    16     c=max(a,b);    
    17     cout<<"max("<<a<<","<<b<<")="<<c<<endl;
    18     cout<<"max("<<15<<","<<11<<")="<<max(15,11)<<endl;
    19     return 0;
    20 }
  • 相关阅读:
    类型转换
    struts2默认拦截器
    struts2自定义拦截器
    struts2之I18N
    代理模式
    抽象类 abstract class 接口
    java基础题
    final
    内部类
    tomcat 端口占用问题解决
  • 原文地址:https://www.cnblogs.com/borter/p/9413051.html
Copyright © 2020-2023  润新知