让我们使用一行代码来求解 #include <iostream> using namespace std; int divisor(int a,int b){return b?divisor(b,a%b):a;} int main(){ int a,b; cin>>a; cin>>b; cout<<divisor(a,b); return 0; }