Linux安全网 - Linux操作系统_Linux 命令_Linux教程_Linux黑客

会员投稿 投稿指南 本期推荐:
搜索:
您的位置: Linux安全网 > Linux编程 > » 正文

HDOJ 1722 Cake 解题报告

来源: 未知 分享至:

http://acm.hdu.edu.cn/showproblem.php?pid=1722

这个嘛。。。。找规律而已。。。。

Run ID Submit Time Judge Status Pro.ID Exe.Time Exe.Memory Code Len. Language Author
4301731 2011-07-31 23:47:58 Accepted 1722 109MS 288K 451 B G++ GongZi

//HDOJ 1722 Code By NetBeans 6.9.1
#include <iostream>

using namespace std;

int gcd( int x, int y );

int main( )
{
int x, y;
while( cin >> x >> y )
{
if( x > y )
{
x
^= y;
y
^= x;
x
^= y;
}
cout
<< x + y - gcd( x, y ) << endl;
}
return 0;
}

int gcd( int x, int y )
{
return ( y == 0 ? x : gcd( y, x % y ) );
}
#if gongzi
#endif

  


Tags:
分享至:
最新图文资讯
1 2 3 4 5 6
验证码:点击我更换图片 理智评论文明上网,拒绝恶意谩骂 用户名:
关于我们 - 联系我们 - 广告服务 - 友情链接 - 网站地图 - 版权声明 - 发展历史