Go: package main

import (
    "fmt"
    "math"
)

func main() {
    var e int
    for {
        fmt.Scan(&e)
        if e == 0 { break }

        var ans float64 = float64(e)
        for z := 0; z <= 101; z++ {
            for y := 0; y <= 1001; y++ {
                x := e - y*y - z*z*z
                if (0 <= x && x <= 100000) {
                  ans = math.Min(ans, float64(x+y+z));
                }
            }
        }
        fmt.Println(ans)
    }
}

C++: 
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#include <cstring>
#include <ctime>


using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); }

//math
//-------------------------------------------
template<class T> inline T sqr(T x) { return x * x; }

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define EXISTch(s,c) ((((s).find_first_of(c)) != std::string::npos)? 1 : 0)//cがあれば1 if(1)
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  FOR(i,0,n)
#define loop(n) FOR(i,0,n)
#define rrep(i,a,b) for(int i=(a);i>=(b);--i)
//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = (int)1000000007;
const LL MOD = (LL)1000000007;//10^9+7
const LL INF2 = (LL)100000000000000000;//10^18

int main() {
	
	while (true) {
		int e; cin >> e;

		if (e == 0)return 0;

		//x+y*y+z*z*z=e;

		LL ans = INF;

		for (LL y = 0; y*y <= e; y++) {
			for (LL z = 0; z*z*z <= e; z++) {
				LL x = e - y * y - z*z*z;

				if (x > 0) {
					ans = min(ans, x + y + z);
				}
			}
		}

		cout << ans << endl;
	}

	return 0;
}

C++: #include <iostream>
#include <cmath>
using namespace std;
int E;
int main(){
  while(cin >> E && E>0){
    int m = 1000000;
    for (int z=0; z<=cbrt(E); z++){
      if(z >= m) break;
        for(int y=0; y<= sqrt(E-z*z*z);y++){
	 if (y+z >= m) break;
	    int x = E - z*z*z - y*y;
	    if (x >= 0){
	      if(x+y+z < m){
		m = x+y+z;
	      }
	    }
      }
    }
    cout << m << endl;
  }
}

C++: // AOJ 2012

#include <iostream>
#include <vector>
#include <cmath>

using namespace std;

int main(void)
{
	vector <int> data;
	for (int i = 1; i*i <= 1000000; i++){
		data.push_back(i*i);
	}

	int e;
	while (cin >> e, e){
		int ret = 1001001001;
		for (int i = 0; 0 <= e - i*i*i; i++){
			int y = sqrt(e - i*i*i);
			int x = e - i*i*i - y*y;
			ret = min(ret, x + y + i);
		}
		cout << ret << endl;
	}

	return 0;
}

C++: #include <cstdio>
#include <iostream>
#include <cmath>
#include <cstring> 
#include <algorithm>

using namespace std;

int main()
{
	int e;
	while(1){
		cin >> e;
		if(e == 0) break;
		int x, y, z, p, m, min_m=1000000;
		for(x = 0; x <= e; x++){
			for(y = 0; y <= 1000; y++){
				if(x + (y * y) > e) break;
				for(int z = 0; z <= 100; z++){
					p = x + (y * y) + (z * z * z);
					if(p > e) break;
					else if(p == e){
						m = x + y + z;
						min_m = min(min_m, m);
					}
				}
			}
		}
		cout << min_m << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <cmath>

using namespace std;

int main( void )
{
	int e;
	while(cin >> e, e) {
		int Min = 1000001, sq_y = (int)(sqrt((double)e) + 1);
		for(int z=0; z < 100; ++z) {
			int sum_z = z * z * z;
			if(sum_z > e) break;
			for(int y=0; y < sq_y; ++y) {
				int sum_zy = sum_z + y * y;
				if(sum_zy > e) break;
				for(int x=0; x <= e; ++x) {
					int sum_zyx = sum_zy + x;
					if(sum_zyx == e) {
						Min = min(Min, z + y + x);
						break;
					}
					else if(sum_zyx > e)
						break;
				}
			}
		}
		cout << Min << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <math.h>

using namespace std;

int main(){
    int e;
    while(cin >> e && e > 0){
        int min;
        min = 1000000;
        for(int y=0; y<=sqrt(e); y++){
            for(int z=0; z<=pow(e,1.0/3.0); z++){
                int m, x;
                m = e - y*y + y - z*z*z + z;
                x = e - y*y - z*z*z;
                if(min > m && x >= 0 ){
                    min = m;
                }
            }
        }
        cout << min << endl;
    }
}

C++: #include <iostream>
#include <cmath>
using namespace std;

#if 0
まず計算量を見積もる。
入力であるeの制約がe ≦ 10^6と大きいことに注目する。
x + y^2 + z^3 = eのもと、総当たりでfor文を回すと計算量はO(n^3)<10^6*10^3*10^2=10^11となり時間制限を越えそうである。
そこで、x=e-z^3-y^2の関係を用いればyとzについてのみ探索すれば良く、計算量はO(n-2)<10^2*10^3=10^5程度になる。これは十分計算可能である。
#endif

int solve(int E){
  int minimum = 100000;
  int x,y,z;

  for(z = 0; z <= 100; ++z)
    for(y = 0; y <= 1000; ++y){
      x = E - y*y - z*z*z;
      if(x >= 0)
        minimum = min(minimum, x + y + z);
    }

  return minimum;
}

int main() {
  int E;
  while(cin >> E && E>0){
    cout << solve(E) << endl;
  }
 }

C++: #include <iostream>
#include <math.h>
using namespace std;

int main()
{
  int e;
  int x = 0;
  int y = 0;
  int z = 0;
  while(cin >> e && e > 0){
    int min = e;
    int zmax = ceil(pow(e, 1.0/3.0));
    int ymax = ceil(pow(e, 1.0/2.0));
    for(int i=0; i<=zmax; i++){
      for(int j=0; j<=ymax; j++){
        int y2 = j * j;
        int z3 = i * i * i;
        x = e - y2 - z3;
        if(x < 0){
          break;
        }
        if(min > x + i + j){
          min = x + i + j;
        }
      }
    }
    cout << min << endl;
  }

  return 0;
}

C++: #include <iostream>


using namespace std;

bool check(int a, int b, int c, int n){
  if (a + b*b + c*c*c == n)
  {
    return true
  }
  return false
}

int solve(int n){
  int a, b, c;
  a = 0;
  b = 0;
  c = 0;
  if(a, b, c){
    return a+b+c;
  }
  for (int i = 0; i < 1000000; ++i)
  {
    if(a, b, c+1){
      return a+b+c;
    }
    if (a, b+1, c)
    {
      return a+b+c;
    }
    if (a+1, b, c)
    {
      return a+b+c;
    }
    if(a, b+1, c+1){
      return a+b+c;
    }
    if (a+1, b, c+1)
    {
      return a+b+c;
    }
    if (a+1, b+1, c)
    {
      return a+b+c;
    }
    if (++a, ++b, ++c)
    {
      return a+b+c;
    }
  }
}


int main(){
  int n
  while(true){
    cin >> n;
    if (n == 0)
    {
      break;
    }
    cout << solve(n) << endl;
  }
}

C++: #include "bits/stdc++.h"
#define ALL(a) (a).begin(),(a).end()
#define debug(x) cout << #x << " : " << (x) << " --------------" << endl;
using namespace std;

int main(void){
    int e;
    while (cin >> e, e) {
        for (int z = 100; z >= 0; --z) {
            int val = z * z * z;
            if (val > e) continue;
            for (int y = sqrt(e-val); y >= 0; --y) {
                int val2 = val + y * y;
                if (val2 > e) continue;
                m = min(m, (e - val2) + y + z);
            }
        }
        cout << m << endl;
    }
    return EXIT_SUCCESS;
}