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 <iostream>

using namespace std;

int main() {
	int e;
	while (cin >> e) {
		if (e == 0) {
			break;
		}
		int i, j, k, m;
		bool hantei = false;
		for (m = 1; ; m++) {
			if (m*m*m < e) {
				continue;
			}
			for (k = m; k >= 0; k--) {
				for (j = m-k; j >= 0; j--) {
					for (i = m-k-j; i >= 0; i--) {
						if (i+j*j+k*k*k == e) {
							hantei = true;
							break;
						}
					}
					if (hantei) {
						break;
					}
				}
				if (hantei) {
					break;
				}
			}
			if (hantei) {
				break;
			}
		}
		cout << m << endl;
	}
	return 0;
}

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++: // Space Coconut Crab
#include <iostream>
using namespace std;
int count = 0; // ?¨???¬??¨ global ?????°
int solve(int E) {
  // ?????´????±???????
  // x+y*y+z*z*z=E
  int ans = E; // ?????§??? 
  for (int x=0; x<=E; ++x)
    for (int y=0; y*y<=E-x; ++y)
      for (int z=0; z*z*z<=E-x-y*y; ++z) {
        ++count;
        if (x+y*y+z*z*z == E)
          if (x+y+z < ans) // x+y+z??????????°??????????ans?????´??°
            ans = x+y+z;
      }
  return ans;
}
int main() {
  int E;
  while (cin >> E && E>0) {
    cout << solve(E) << endl; 
  }
}
// ?????´?????????????????¨?????????????????????????????? 10^11???...8?§???\?????????
//

C++: #include<iostream>
#include<cstdio>
#include<cstdlib>
#include<stdexcept>
#include<cmath>
#include<fstream>
#include<memory>
#include<algorithm>
#include<cstring>
#include<ctime>
#include<deque>
#include<sstream>
#include<iomanip>
#include<sstream>
#include<vector>
#include<queue>
#include<stack>
#include<string>
#include<climits>
#include<map>
#include<set>
#include<list>
#include<cassert>
#include<deque>
#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define INF 1<<27
#define all(n) n.begin(),n.end()
#define insert(a,b,c,d) PP(P(a,b),P(c,d))
#define F first
#define iter(c) __typeof__((c).begin())
#define foreach(i,c) for(iter(c) i=(c).begin();i!=(c).end();++i)
#define S second
#define pb push_back
#define pf push_front
#define LIM 100000
using namespace std;
typedef pair<int,int> P;
typedef pair<P,P> PP;
typedef long long ll;
typedef unsigned long long ull;

int main(){

  int e;
  while(true){
    cin >> e;
    if(!e)break;
    int x,y,z,mine;
    mine = INF;
    for(int i=0;i<=sqrt(e)+1;i++){
      for(int j=0;j<=100;j++){
	if(pow((double)j,3) > e)break;
	y = pow((double)i,2);
	if(y > e)break;
	z = pow((double)j,3);
	if(y+z > e)break;
	x = e - (y+z);
	if(x+i+j < mine)mine = x+i+j;
      }
    }

    cout << mine << endl;
  }
return 0;
}

C++: #include <bits/stdc++.h>
#define For(i, a, b) for(int (i)=(a); (i)<(b); ++(i))
#define rFor(i, a, b) for(int (i)=(a)-1; (i)>=(b); --(i))
#define rep(i, n) For((i), 0, (n))
#define rrep(i, n) rFor((i), (n), 0)
#define fi first
#define se second
using namespace std;
typedef long long lint;
typedef unsigned long long ulint;
typedef pair<int, int> pii;
typedef pair<int, lint> pil;
typedef pair<lint, int> pli;
template<class T>bool chmax(T &a, const T &b){if(a<b){a=b; return true;} return false;}
template<class T>bool chmin(T &a, const T &b){if(a>b){a=b; return true;} return false;}

constexpr lint mod = 1e9+7;
constexpr lint INF = mod*mod;
constexpr int MAX = 1000010;

int main(){
        int e;
        while(scanf("%d", &e) && e){
                int m=MAX;
                for(int z=0; z*z*z<=e; ++z){
                        for(int y=0; y*y<=e; ++y){
                                int x=e-z*z*z-y*y;
                                if(x>=0) chmin(m, x+y+z);
                        }
                }
                printf("%d\n", m);
        }
}

C++: #include <bits/stdc++.h>

using namespace std;

#define min(a, b) ((a) < (b)? (a):(b))
#define max(a, b) ((a) > (b)? (a):(b))
#define rep(i, n) REP(i, 0, (n))
#define REP(i, a, n) for(typeof(n) i=(a); i<(n); i++)

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

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

using namespace std;


int cast(int e)
{
	
	
	 int x = 0,y = 0,z = 0;
	 double tmp;

	 for(int i = 2;;i++)
	 {
		 if(e >= pow(i,3))
		 {
			 z = i;
		 }else
		 {
			 e = e - pow(z,3);
			 break;
		 }
	 }

	 for(int i = 2;;i++)
	 {
		 if(e >= pow(i,2))
		 {
			 y = i;
		 }else
		 {
			 e = e - pow(y,2);
			 break;
		 }
	 }
	 for(int i = 0;;i++)
	 {
		 if(e == i)
		 {
			 x = i;
			 break;
		 }
	 }


	return x + y + z;
}


int main()
{

  while(1)
  {
	 int e;

	 cin >> e;
 
	 if(!e)break;
	
	 cout << cast(e) << endl;

  }

  return 0;
}

C++: #include<bits/stdc++.h>

using namespace std;

int main(){
  int e;

  while(1)
    {
      cin >> e;
      if(e == 0)break;
      for(int x=0;x <= e;x++)
	for(int y=0;y<= e;y++)
	  for(int z=0;z<= e;z++)
	    {
	      if(x + y*y + z*z*z == e)
		{
		  cout << x+y+z << endl;
		  return 0;
		}
	    }
    }
  return 0;
}