Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
96697 刘轻松 15求两个数的最大公约数 C++ Time Limit Exceeded 1000 MS 272 KB 282 2024-11-09 11:55:45

Tests(0/10):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ long long a,b,yushu,t; cin>>a>>b; if(a<b){ t =a; a = b; b = t; } //辗转相处法-求最大公约数 yushu = a%b; while(yushu != 0){ a = b; b = yushu; } cout<<b; return 0; }