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;

typedef long long ll;

int main() {
    ll e,x,y,z,m;
    while(cin>>e, e) {
        m = 1ll<<62;
        for(z = 0; z*z*z<=e; ++z) {
            for(y = 0; z*z*z+y*y<=e; ++y) {
                x = e - z*z*z - y*y;
                m = min(x+y+z, m);
            }
        }

        cout<<m<<endl;
    }
}

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

#define rep(i,n) for(int i = 0; i < n; i++)
#define rrep(i,n) for(int i = n - 1; i >= 0; i--)
#define REP(i,k,n) for(int i = k; i < n; i++)

#define vi vector<int>
#define pb push_back
using namespace std;

int main(){
    int e;
    while(cin >> e,e) {
        int m = 1000000;
        for(int y = 0; pow(y,2) <= e; y++) for(int z = 0; pow(z,3) <= e; z++) {
                int x = e - pow(y,2) - pow(z,3);
                if(x >= 0) {
                    m = min(m,x + y + z);
                }
            }
        cout << m << endl;
    }

    return 0;

}

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

using namespace std;
int main() {
	int e;
	while(cin >> e && e > 0){
		int min_sum = 100000;
		for(int i = 0; i*i*i <= e; i++)
		{
			int j = sqrt(e - i*i*i);
			int k = e - i*i*i - j*j;
			int temp = i + j + k;
			min_sum = min(temp, min_sum);
		}
		cout << min_sum << endl; 
	}	
}

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

int e = 0;

int solve(){
    int x,y,z;

    int y_max, z_max;
    for(x=0; x<=e; ++x){
        y_max = pow(e-x,0.5)+1;
        for(y=0; y<=y_max; ++y){
            z_max = pow(e - x - y*y,0.34)+1;
            for(z=0; z<z_max; ++z){
                if((x+y*y+z*z*z) == e){
                    return x + y + z;
                }
            }
        }
    }
    return 0;
}

int main(void){
    while(true){
        std::cin >> e;
        if(e == 0) break;
        std::cout << solve() << std::endl;
    }
}

C++: #include <bits/stdc++.h>
using namespace std;
int main(){
  int e;
  vector<int> ans;
  while(cin >> e,e){
    vector<int> combi;
    for(int y = 0;e-y*y+y >= 0;y++){
      for(int z = 0;e-y*y+y-z*z*z+z >= 0;z++){
        if(e-y*y-z*z*z >= 0)combi.push_back(e-y*y+y-z*z*z+z);
      }
    }
  int q = 1000000;
  for(int i = 0;i < combi.size();i++)q = min(q,combi[i]);
  ans.push_back(q);
  }
  for(int i = 0;i < ans.size();i++)cout << ans[i] << endl;
}

C++: #include <iostream>
#include <cmath>
using namespace std;
int calcOver(int, int);

int main() {
  while(true) {
    int e;
    cin >> e;
    if(e == 0) break;
    int y = 0;
    int z = 0;
    int maxover = 0;
    int limity = pow(e, 1.0 / 2.0);
    int limitz = pow(e, 1.0 / 3.0);
    int maxy = limity;
    int maxz = limitz;
    //cout << limity << ":" << limitz << endl;
    for(y = limity; y >= 0; --y) {
      for(int z = limitz; z >= 0; --z) {
        int over = calcOver(y, z);
        //cout << y << ":" << z << ":" << over << endl;
        if(e >= over) {
          //cout << "ok" <<endl;
          if(maxover <= over && ((maxy + maxz) >= (y + z))) {
          //cout << "ok" <<endl;
            maxy = y;
            maxz = z;
            maxover = over;
          }
          break;
        }
      }
    }
    //cout << maxy << ":" << maxz << endl;
    cout << (e - pow(maxy, 2) - pow(maxz, 3) + maxy + maxz) << endl;
  }
  return 0;
}

int calcOver(int y, int z) {
  return (pow(y, 2) + pow(z, 3));
}

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

using namespace std;

int main() {
	int e;
	while (cin >> e && e) {
		int ans = 1e9;
		for (int i = 0; i * i * i <= e; ++i) {
			for (int j = 0; j * j <= e - i * i * i; ++j) {
				ans = min(ans, i + j + e - (i * i * i + j * j));
			}
		}
		cout << ans << endl;
	}

	return 0;
}

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

using namespace std;

int main() {
	int hyou[101];
	for (int i = 0; i < 101; i++) {
		hyou[i] = i*i*i;
	}
	int e;
	while (cin >> e) {
		if (e == 0) {
			break;
		}
		int a, b, c;
		for (int i = 1; ; i++) {
			if (hyou[i] > e) {
				c = i-1;
				break;
			}
		}
		for (int i = 1; ;i++) {
			if (i*i > e-hyou[c]) {
				b = i-1;
				break;
			}
		}
		for (int i = 1; ;i++) {
			if (i > e-hyou[c]-b*b) {
				a = i-1;
				break;
			}
		}
		int MIN = a+b+c;
		for (int i = c-1; i >= 0; i--) {
			int p;
			for (int j = b+1; ; j++) {
				if (j*j > e-hyou[i]) {
					p = j-1;
					break;
				}
			}
			int q = e-hyou[i]-p*p;
			MIN = min(MIN, p+q+i);
		}
		cout << MIN << endl;
	}
	return 0;
}

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

using namespace std;

//debug
#define DUMP(x)  cerr << #x << " = " << (x) << endl;
#define DEBUG(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

const int MILLION = 1000000;
int main(){
    int result=1000000;
    int input;
    bool flag=true;
    while(cin >> input && input){
	for(int i=0; i*i*i<=input; i++){
	    for(int j=0; j*j<=input-i*i*i; j++){
//		    if(i*i*i+j*j+k==input)
		int k = input - i*i*i - j*j;
		int temp = i+j+k;
		result = min(result, temp);

		}
	    }
	cout << result << endl;
	result = 1000000;
    }
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

int main(){

	  while(1){
			int e; cin >> e;
			if(!e) break;

			int mini = e;
			for(int x=0; x<=e; x++){
				  for(int y=0; y*y<=e; y++){
						for(int z=0; z*z*z<=e; z++){
							  if(x + y*y + z*z*z == e)
									mini = min(mini,x+y+z);
						}
				  }
			}
			cout << mini << endl;

	  }

}

C++: #include <bits/stdc++.h>
using namespace std;

#define iota(i,n,b,s) for(int i=int(b);i!=int((b)+(s)*(n));i+=(s))
#define range(i,n,m) iota(i,(((n)>(m))?((n)-(m)):((m)-(n))),(n),((n)>(m)?-1:1))
#define rep(i,n) iota(i,(n),0,1)
#define loop for(;;)

#define INF (1e9)
#define EPS (1e-9)
#define cons(a,b) (make_pair(a,b))
#define car(a) (a.first)
#define cdr(a) (a.second)
#define cadr(a) (car(cdr(a)))
#define cddr(a) (cdr(cdr(a)))
#define all(a) a.begin(), a.end()
#define trace(var) cerr<<">>> "<<#var<<" = "<<var<<endl;

typedef long long Integer;
typedef double Real;
typedef vector<int> vi;
typedef vector<string> vs;
typedef map<string,int> Dictionary;
const Real PI = acos(-1);

template<class S, class T>
ostream& operator<<(ostream& os, pair<S,T> p) {
  os << '(' << car(p) << ", " << cdr(p) << ')';
  return os;
}

template<class T>
ostream& operator<<(ostream& os, vector<T> v) {
  if (v.size() == 0) {
    os << "(empty)";
    return os;
  }
  os << v[0];
  for (int i=1, len=v.size(); i<len; ++i) os << ' ' << v[i];
  return os;
}

int dx[] = { -1, 0, 1, 0 };
int dy[] = {  0, -1, 0, 1 };

int main() {

  for (int e;cin>>e,e;) {
    int m = INF;
    for (int z = 0; z * z * z <= e; ++z) {
      for (int y = 0; y*y + z*z*z <= e; ++y) {
        int x = e - y*y - z*z*z;
        m = min(m, x + y + z);
      }
    }
    cout << m << endl;
  }



  return 0;
}