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>
#include <cmath>
using namespace std;

int main(int argc, char *argv[])
{
    int x, y, z, e, m, z3, y2;
    while (cin >> e, e) {
        m = 1000000;
        for (int z = 0; z <= 100; ++z) {
            z3 = z*z*z;
            if (z3 > e)
                break;
            for (int y = 0; y <= sqrt(e - z3); ++y) {
                y2 = y*y;
                for (int x = 0; x <= e - (y2+z3); ++x) {
                    if (x + y2 + z3 == e)
                        m = min(m, x + y + z);
                }
            }
        }
        cout << m << endl;
    }
    return 0;
}

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

int main(){
  int e;
  while(cin >> e,e){
    int x,y,z;
    int min = 10000;
    for(int i=0; i*i*i<=e; ++i){
      for(int j=0; j*j<=e-(i*i*i); ++j){
	for(int k=0; k<=e-(i*i*i)-(j*j); ++k){
	  if(e == i*i*i+j*j+k && min > i+j+k){
	    min = i+j+k;
	    //break;
	  }
	}
	//if(min != 10000)break;
      }
      //if(min != 10000)break;
    }
    cout << min << endl;
  }
  return 0;
}

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

#define mp make_pair
#define pb push_back
#define REP(i,a,n) for(int i = a;i < (n);i++)
#define rep(i,n) for(int i = 0;i < (n);i++)
#define all(s) s.begin(), s.end()
#define rall(s) s.rbegin(), s.rend()
#define range(x,min,max) ((min) <= (x) && (x) <= (max))
#define xyrange(x, minX, maxX, y, minY, maxY) (range(x, minX, maxX) && range(y, minY, maxY))

using namespace std;

typedef long long LL;
typedef vector<int> VI;
typedef vector<vector<int> > VVI;
typedef vector<string> VS;
typedef vector<bool> VB;
typedef pair<int,int> PII;
typedef vector<PII> VPII;

int e;

const int DX[]={1,0,-1,0},DY[]={0,-1,0,1};
const int INF = INT_MAX / 2;

int main(){
	cin.tie(0);
   	ios::sync_with_stdio(false);
	while (1) {
		cin >> e;
		if (e == 0) break;
		int m = [&] {
			rep (x, 10 * 10 * 10 + 1) {
				rep (y, 10 * 10 + 1) {
					rep (z, 10 + 1) {
						if (x + y * y + z * z * z == e) {
							return x + y + z;
						}
					}
				}
			}
		}();
		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;

		int ans = INF;

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

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

		cout << ans << endl;
	}

	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(x) (x).begin(),(x).end()
const int mod=1000000007,MAX=1<<18,INF=1<<30;
vector<int> dx={-1,0,1,0},dy={0,-1,0,1};

int main(){
    
    std::ifstream in("text.txt");
    std::cin.rdbuf(in.rdbuf());
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    while(1){
        int N;cin>>N;
        if(N==0) break;
        int ans=N;
        
        for(int i=0;i<=1000;i++){
            for(int j=0;j<=100;j++){
                if(i*i+j*j*j>N) continue;
                
                ans=min(ans,i+j+(N-i*i-j*j*j));
            }
        }
        
        cout<<ans<<endl;
    }
    
}

C++: #include <iostream>
using namespace std;
int main(){
  int e;

  while(cin >> e, e ){
    int m = 1e8;
    for( int z=0;; z++ ){
      int zzz = z*z*z;
      if( zzz > e )
	break;
      for( int y=0;; y++ ){
	int yy = y*y;
	if( zzz + yy > e )
	  break;

	int x = e-zzz-yy;
	m = min( m, x+y+z);
      }
    }
    cout << m << endl;

  }

}

C++: #include<iostream>
#include<math.h>
#include<limits.h>
using namespace std;
int count = 0;
int solve(int E)
{
  int ans =INT_MAX;
  for (int z=0; z*z*z<=E; ++z)
    for (int y=0; y*y<=E; ++y)
      {
	//cout<<"y="<<y<<endl;
	int x=(int)round(E-z*z*z-y*y);
	//cout<<"z="<<z<<endl;
	if (x+y*y+z*z*z == E)
	{
	  if((x+y+z)<ans)
	  {
	    ans=x+y+z;
	    // cout<<ans<<endl;
	  }
	}
      }
  return ans;
}
int main()
{
  int E;
  while (cin >> E && E>0)
  {
    cout << solve(E) << endl;
  }
}

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

using namespace std;

int main(){
	int e;
	while(cin >> e,e){
		int minn = e;
		int res;
		for(int y=0;y<=e/2;y++){
			if(y*y > e) break;
			for(int z=0;z<=e/3;z++){
				if(z*z*z+y*y > e) break;
				int x = e - y*y - z*z*z;
				res = x + y + z;
				if(res < minn){
					minn = res;
				}
			}
		}
		cout << minn << endl;
	}
	return 0;
}