Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
94784 杜洛雨泽 最大公约数 C++ Wrong Answer 1 MS 272 KB 315 2024-10-26 13:26:19

Tests(0/1):


Code:

#include <bits/stdc++.h> using namespace std; int main (){ int a,b,f; cout<<"请输入第一个整数:"; cin>>a; cout<<"请输入第二个整数:"; cin>>b; f=(a<b)?a:b; while(f>0){ if(a%f==0&&b%f==0){ break; } f--; } cout<<"最大公约数:"<<f<<endl; return 0; }


Run Info:

------Input------
234 396
------Answer-----
18
------Your output-----
请输入第一个整数:请输入第二个整数:最大公约数:18