Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
96664 刘佳宇 15求两个数的最大公约数 C++ Accepted 1 MS 272 KB 291 2024-11-09 11:39:05

Tests(10/10):


Code:

#include<iostream> using namespace std; int main(){ int a,b,min; cin>>a>>b; if(a<b){ min=a; } else{ min=b; } for(int i=min;i>=1;i--){ if(a%i==0 && b%i==0){ cout<<i; return 0; } } }