hdoj 2551

来源:互联网 发布:知乎 三体问题 编辑:程序博客网 时间:2024/06/04 21:11

http://acm.hdu.edu.cn/showproblem.php?pid=2551

//水题#include <iostream>#include <cmath>using namespace std;int main(){ int t, n, x; int i, j; cin >> t; while (t--) {  cin >> x;  n = 0; i = 1;  while (x > 0) {   n++;   x = x - pow((double)i,3);   i++;  }  cout << n << endl; } return 0;}


 

原创粉丝点击