0
点赞
收藏
分享

微信扫一扫

HDOJ  2044   一只小蜜蜂...

未定义变量 2022-08-22 阅读 214


题目:​​http://acm.hdu.edu.cn/showproblem.php?pid=2044​​

题目告诉的从哪里走到哪里其实不重要,而是看你走了多少,

__int64,菲波拉数列

#include <stdio.h>
#include <math.h>
int main()
{
int t,a,b;
__int64 p[51]={0,1,2,3};
scanf("%d",&t);
while(t--)
{
scanf("%d%d",&a,&b);
a=fabs(a-b);
for(int i=4;i<=a;i++)
p[i]=p[i-1]+p[i-2];
printf("%I64d\n",p[a]);
}
return 0;
}

举报

相关推荐

0 条评论