hdu 1722 Cake
来源:互联网 发布:怎么测试80端口 编辑:程序博客网 时间:2024/06/05 23:51
公式 p+q-gcd(p,q)就是所求值
#include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;
int gcd(int n,int m)
{
if(m==0)
return n;
gcd(m,n%m);
}
int main()
{
int m,n;
while(cin>>m>>n)
{
cout<<m+n-gcd(m,n)<<endl;
}
}
- HDU-1722 Cake
- hdu 1722 Cake
- hdu 1722 Cake
- HDU 1722 Cake
- hdu 1722 Cake
- HDU 1722 Cake
- hdu 1722 Cake 数学题
- hdu 1722 Cake
- HDU 1722 Cake
- hdu 1722cake
- HDU 1722 Cake
- hdu 1722--Cake
- hdu 1722 Cake
- hdu---1722 Cake
- HDU 1722 Cake
- hdu 1722 Cake(gcd)
- HDU 1722 Cake
- hdu 1722 Cake
- Using Bluetooth
- 十个超级有用的PHP代码片段
- dos常用命令---路由跟踪命令.查看DNS、IP、Mac等
- utl_dbws.ANYDATA_LIST类型初始化问题
- SQL CROSS APPLY OUTER APPLY PIVOT UNPIVOT
- hdu 1722 Cake
- 丢掉的LBUTTONDOWN - ocx消息处理 和 AfxGetApp的使用注意
- jQuery事件函数
- jQuery事件 实例
- 代码资源
- 中文化和国际化问题权威解析
- jQuery 效果
- 用.net获取重定向之后的地址
- lighttpd 日志格式设置