HDOJ   2551   竹青遍野
2015-12-18 18:08
483 查看
题目:http://acm.hdu.edu.cn/showproblem.php?pid=2551
#include <stdio.h>
#include <math.h>
int main()
{
int
T,n,i;
scanf("%d",&T);
while(T--)
{
scanf("%d",&n);
for(i=1;i<=1000;i++)
{
n-=pow(i,3);
if(n<=0)
{
printf("%d\n",i);
break;
}
}
}
return
0;
}
#include <stdio.h>
#include <math.h>
int main()
{
int
T,n,i;
scanf("%d",&T);
while(T--)
{
scanf("%d",&n);
for(i=1;i<=1000;i++)
{
n-=pow(i,3);
if(n<=0)
{
printf("%d\n",i);
break;
}
}
}
return
0;
}
相关文章推荐
- HDOJ&nbsp;&nbsp;2550&nbsp;&nbsp;&nbsp;百步穿杨
- HDOJ&nbsp;&nbsp;2549&nbsp;&nbsp;&nbsp;&nbsp;壮志难酬
- 安装时防火墙未关闭报错
- 数据分析师考试和scanf读取数据的问题
- C++处理异常技巧-try,catch,throw,finally
- Android网络连接判断与处理
- java提高篇(二三)-----HashMap
- HDOJ&nbsp;&nbsp;2548&nbsp;&nbsp;&nbsp;两军交锋
- HDOJ&nbsp;&nbsp;2500&nbsp;&nbsp;&nbsp;做一个正气的杭电人
- HDOJ&nbsp;1847&nbsp;&nbsp;&nbsp;Good&nbsp;Luck&nbsp;in&nbsp;CET-4&nbsp;E…
- HDOJ&nbsp;&nbsp;1846&nbsp;&nbsp;&nbsp;Brave&nbsp;Game
- HDOJ&nbsp;1028&nbsp;&nbsp;&nbsp;Ignatius&nbsp;and&nbsp;the&nbsp;Pri…
- 整数拆分问题
- HDOJ&nbsp;&nbsp;&nbsp;2081&nbsp;&nbsp;&nbsp;手机短号
- HDOJ&nbsp;&nbsp;&nbsp;2072&nbsp;&nbsp;&nbsp;单词数
- HDOJ&nbsp;&nbsp;2025&nbsp;&nbsp;&nbsp;查找最大元素
- HDOJ&nbsp;&nbsp;2024&nbsp;&nbsp;&nbsp;&nbsp;C语言合法标识符
- HDOJ&nbsp;&nbsp;2016&nbsp;&nbsp;&nbsp;数据的交换输出
- HDOJ&nbsp;&nbsp;2014&nbsp;&nbsp;&nbsp;&nbsp;青年歌手大奖赛_评…
- HDOJ&nbsp;&nbsp;&nbsp;2013&nbsp;&nbsp;&nbsp;&nbsp;蟠桃记