题解 1142: C语言训练-立方和不等式

来看看其他人写的题解吧!要先自己动手做才会有提高哦! 
返回题目 | 我来写题解

筛选

简单循环判断

摘要:解题思路:这个题目用while或者do while语句很方便,比for循环嵌套if判断更简便!注意事项:参考代码:#include <stdio.h>#include <math.h……

简单题,但也要注意一下审题

摘要:解题思路:注意事项:这题其他的没啥很简单主要注意一下结束循环后sum分两种情况,一种是恰好相等,另一种是大于n。参考代码:#include <iostream>#include<cmath>using……

最后要减一个2

摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<math.h>int f(int a){ int sum=0,i=1; while(sum&l……

简简单单的循环

摘要:解题思路:注意事项:参考代码:#include<stdio.h> int main(void) {     int n, i = 0;     scanf("%d", &n);     in……

1142: C语言训练-立方和不等式

摘要:解题思路:注意事项:注意sun == n的时候直接输出i就行了。参考代码:#include<stdio.h>#include<math.h> int main(){ int a,sum = 0; sc……