您的位置:首页 > 其它

王小二切饼

2016-11-12 00:03 176 查看


王小二切饼

Time Limit: 1000MS Memory Limit: 65536KB

Submit Statistic


Problem Description

王小二自夸刀工不错,有人放一张大的煎饼在砧板上,问他:“饼不许离开砧板,切n(1<=n<=100)刀最多能分成多少块?”


Input

输入切的刀数n。


Output

输出为切n刀最多切的饼的块数。


Example Input

100



Example Output

5051


#include<stdio.h>
int main()
{
long f[101];
int i,n;
scanf("%d",&n);
{
f[0]=1;
for(i=1;i<=n;i++)
{
f[i]=f[i-1]+i;
}
printf("%ld\n",f
);
}
return 0;

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: