求最大公约数。提交 hcf函数即可。
时间: 1ms 内存:128M
描述:
#include <iostream>
using namespace std;int hcf(int m,int n);
int main()
{int x,y,a;
cin>>x>>y;
a=hcf(x,y);
cout<<a;
return 0;}
输入:
输出:
示例输入:
21 9
示例输出:
3
提示:
参考答案:
解锁文章
求最大公约数。提交 hcf函数即可。
时间: 1ms 内存:128M
描述:
#include <iostream>
using namespace std;int hcf(int m,int n);
int main()
{int x,y,a;
cin>>x>>y;
a=hcf(x,y);
cout<<a;
return 0;}
输入:
输出:
示例输入:
21 9
示例输出:
3
提示:
参考答案:
文章评论