#10745. 数论第四题(NOIP2009)

数论第四题(NOIP2009)

第四题(NOIP2009)

#include<iostream>
using namespace std;
int a,b;
int work(int a,int b){
    if(a%b) return work(b,a%b);
    return b;
}
int main() {
    cin>>a>>b;
    cout<<work(a,b)<<endl;
    return 0;
}
  1. 【判断题】在第2行下面添加#define int long long程序可以正常运行。
    {{ select(1) }}
  • 正确
  • 错误
  1. 【判断题】将第3行的int改成double结果不会改变。
    {{ select(2) }}
  • 正确
  • 错误
  1. 【判断题】不能输入0 0。
    {{ select(3) }}
  • 正确
  • 错误
  1. 【判断题】输入20 12结果输出4。
    {{ select(4) }}
  • 正确
  • 错误
  1. 【选择题】输入2012 13,输出( )。
    {{ select(5) }}
  • 2012
  • 2013
  • 13
  • 1
  1. 【选择题】该算法的时间复杂度级别为( )。
    {{ select(6) }}
  • 线性时间
  • 对数时间
  • 平方时间
  • 常数时间