解题思路:
注意事项: 没什么说的,注意1就行
参考代码:
#include <cstdio> #include <cstring> #include <string> #include <cmath> #include <cctype> #include <functional> #include <iostream> #include <algorithm> using namespace std; int main() { int n, sum = 0; scanf("%d", &n); if(n == 1) { printf("1\n"); } for(int i = 1; i <= n; ++i) { sum += i*i*i; if(sum > n) { printf("%d\n", i-1); break; } } return 0; }
0.0分
0 人评分
十->二进制转换 (C语言代码)浏览:1291 |
C语言程序设计教程(第三版)课后习题6.9 (C语言代码)浏览:640 |
Cylinder (C语言描述+详细分析)浏览:3265 |
C语言程序设计教程(第三版)课后习题4.9 (C语言代码)浏览:560 |
1128题解(返回值为数组的情况)浏览:473 |
用筛法求之N内的素数。 (C语言代码)浏览:529 |
矩阵转置 (C语言代码)浏览:783 |
C语言程序设计教程(第三版)课后习题8.4 (C语言代码)浏览:559 |
2003年秋浙江省计算机等级考试二级C 编程题(1) (C语言代码)浏览:615 |
C语言程序设计教程(第三版)课后习题7.4 (C语言代码)浏览:510 |