ch3.8.9.cc

来自「C++ source code for book-C++ and Object 」· CC 代码 · 共 21 行

CC
21
字号
#include <iostream>     // include a library for input and output 
#include <cstdlib>       // include a library for atoi

using namespace std;

int gcd(int m, int n) {        // greatest common divisor
  static int callnum = 1;

  cout << "The function gcd() has been called " << callnum++ 
       << " times so far.\n";

  if (n == 0) return m;
  return gcd(n,m%n);
}

int main(int argc, char* argv[]) {

  int i = gcd(2215,335);
  cout << " i = " << i << '\n';
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?