Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
78331 杨珞烯 15求两个数的最大公约数 C++ Wrong Answer 1 MS 268 KB 223 2024-06-18 18:45:29

Tests(0/10):


Code:

#include <iostream> using namespace std; int main(){ int a,b,zd=0,n,s=1; cin>>a>>b; if(a<b){ n=a; }else{ n=b; } while(s<=n){ if(a%s==0||b%s==0){ zd=n; } s++; } cout<<zd; return 0; }


Run Info:

------Input------
49 47
------Answer-----
1
------Your output-----
47