函数默认参数

  1. // 定义
  2. int sum(int a,int b=10){
  3. return a+b;
  4. }
  5. // 调用
  6. sum(a);
  7. // 如果使用默认值的话,可以省略一个参数