会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
サ繌н筻刂挭
博客园
首页
新随笔
联系
订阅
管理
PKU 1067 取石子游戏
#include
<
iostream
>
#include
<
algorithm
>
#include
<
cmath
>
using
namespace
std;
int
main()
{
int
ax,bx,temp;
int
k,wantedax;
while
(scanf(
"
%d%d
"
,
&
ax,
&
bx)
!=
EOF)
/**/
/*
题中没有输入结标志时,必须这样写,否则会WA
*/
{
if
(ax
>
bx)
swap(ax,bx);
k
=
bx
-
ax;
wantedax
=
(floor)( k
*
(
1.0
+
sqrt(
5.0
))
/
2.0
);
if
(ax
==
wantedax)
printf(
"
%d\n
"
,
0
);
else
printf(
"
%d\n
"
,
1
);
}
return
0
;
}
posted @
2009-04-29 16:54
黄浩贤
阅读(
264
) 评论(
0
)
收藏
举报
刷新页面
返回顶部
公告