| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 68482 | 李星熠 | 公约数问题 | C++ | Wrong Answer | 1 MS | 268 KB | 362 | 2024-03-23 14:56:50 |
#include <iostream> using namespace std; int CommFactor1(int m, int n); //函数的声明 int main() { int a, b; cin >> a >> b; cout << "这两个数的最大公约数为:" << CommFactor1(a,b)<< endl; return 0; } int CommFactor1(int m,int n) { int tem; for (tem = m;; tem--) { if (m % tem == 0 && n % tem == 0) { break; } } return tem; }
------Input------
7 7
------Answer-----
7
------Your output-----
这两个数的最大公约数为:7