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 <bits/stdc++.h>
using namespace std ;

#define pb(n) push_back(n)
#define fi first
#define se second
#define all(r) (r).begin(),(r).end()
#define gsort(st,en) sort((st),(en),greater<int>())
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)
#define vary(type,name,size,init) vector< type> name(size,init)
#define vvl(v,w,h,init) vector<vector<ll>> v(w,vector<ll>(h,init));

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define REP(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using dict = map<string,int>;
using pii = pair<int,int> ;
using pll = pair<ll,ll> ;

const int mod = 1000000007;
constexpr int imax = ((1<<30)-1)*2+1 ;
constexpr int inf = 100000000;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
const int dy[] = {-1,0,1,0,1,-1,1,-1};
const int dx[] = {0,-1,0,1,1,-1,-1,1};

inline bool value(int x,int y,int w,int h){
  return (x >= 0 && x < w && y >= 0 && y < h);
}

template<typename T>
void Unique(vector<T> &v){
  sort(all(v));
  v.erase(unique(all(v)),v.end());
}

template<typename T>
T ston(string& str, T n){
  istringstream sin(str) ;
  T num ;
  sin >> num ;
  return num ;
}

void Ans(bool f){
  if(f) cout << "YES"<<endl;
  else cout << "NO"<<endl;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  double e;
  while(cin >> e && e){
    double m = inf;
    for(int i = 0; i <= 100; ++ i){
      for(int j = 0; int(e - pow(i,3) - pow(j,2)) >= 0; ++ j){
        double x = e - pow(i,3) - pow(j,2) ;
        if(x >= 0 && x <= 1000000){
          m = min(m,i+j+x);
        }
      }
    }
    cout << m << endl;
  }
  return 0;
}

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

const int MAX_INT = 2147483647;

using namespace std;
int main(){
    int x,e,m,ypi,zpi;
    while(true){
        cin >> e;
        if(e==0) break;
        int minM=MAX_INT;
        for(int zi=0;zi<100;zi++){
            zpi=zi*zi*zi;
            if (e-zpi<0) break;
            for(int yi=0;yi<1000;yi++){
                ypi=yi*yi;
                if(e-ypi-zpi<0) break;
                x=e-ypi-zpi;
                m=x+yi+zi;
                minM=min(minM,m);
            }
        }
        cout << minM << endl;
    }
    return 0;
}

C++: #include <bits/stdc++.h>
#define REP(i,n) for(int i = 0; i < (int)(n); ++i)
using namespace std;

int main(){
    int x = 0, y = 0, z = 0;
    int m = 1000000, e = 0;
    while(cin >> e && e > 0){
        while(z*z*z <= e){
            z++;}
        z--;
        REP(i,z+1){
            y = 0;
            while(y*y <= e-i*i*i){
                y++;
            }
            y--;
            x = e - y*y - i*i*i;
            m = min(x+y+i,m);
        }
        cout << m << endl;
        m = 1000000;
    }
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define FOR(i, s, n) for(int i = s; i < (int)n; i++)
#define per(i, n) for(int i = n; i >= 0; i--)
#define ROF(i, s, n) for(int i = s; i >= (int)n; i--)
#define FORIT(i, A) for (auto i : A)
#define PRINT(x) cout << (x) << "\n"
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define MP make_pair
#define EACH(i, n) for (__typeof((n).begin()) i = (n).begin(); i != (n).end(); ++i)
#define SZ(a) int((a).size())
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define CLR(a) memset((a), 0 ,sizeof(a))
#define dump(x) cout << #x << " = " << (x) << "\n";
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << "\n";
#define sq(n) (n) * (n)
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef priority_queue<int> maxpq;
typedef priority_queue< int, vector<int>, greater<int> > minpq;
static const double EPS = 1e-10;
static const double PI = acos( -1.0 );
static const int mod = 10007;
static const int INF = 1 << 25;
static const LL LL_INF = 1152921504606846976;
static const int dx[] = { -1, 0, 1, 0,  1, -1,  1, -1 };
static const int dy[] = { 0, -1, 0, 1 , 1,  1, -1, -1 };

int n;

int main() {
	while ( ~scanf( "%d", &n ) && n ) {
		for ( int i = 0; i <= n; i++ ) {
			for ( int j = 0; j <= n; j++ ) {
				for ( int k = 0; k <= n; k++ ) {
					if ( i + j * j + k * k * k > n ) {
						break;
					}
					if ( i + j * j + k * k * k == n ) {
						printf( "%d\n", i + j + k );
						goto case_end;
					}
				}
			}
		}
	case_end:;
	}
	return 0;
}

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

int main() {

	int E,X,tempmin;
	int min;

	while(true) {
		cin >> E;
		if(E == 0) {
			break;
		}
		min = 1000000;
		for(int Z = 0; pow(Z,3.0)<=E; Z++) {
			for(int Y = 0; pow(Y,2.0)<=(E-pow(Z,3.0)); Y++) {
				X = E-pow(Y,2.0)-pow(Z,3.0);
				tempmin = X+Y+Z;
				//cout << X << " " << Y << " " << Z << endl;
				//cout << tempmin << endl;
				if((tempmin<min) && (X+pow(Y,2.0)+pow(Z,3.0) == E)) {
					min = tempmin;
					
				}
			}
		}
		cout << min << endl;

	}
	return 0;
}

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

const int INF = (int)1e9;

int solve(int E) {
    int res = INF;
    for(int y = 0; y*y <= E; y++) {
        for(int z = 0; y*y + z*z*z <= E; z++) {
            if(res > y + z + E - y*y - z*z*z) {
                res = y + z + E - y*y - z*z*z;
            }
        }
    }
    return res;
}

int main() {
    for(int E; cin >> E, E; ) {
        cout << solve(E) << endl;
    }
}

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

typedef long long int integer;

integer solve(integer e) {
  integer ans = 1100100100;
  for (integer z = 0; z*z*z <= e; z++) {
    for (integer y = 0; z*z*z + y*y <= e; y++) {
      ans = min(ans, (e-y*y-z*z*z) + y + z);
    }
  }
  return ans;
}

int main() {
  integer e;
  while (cin >> e and e != 0) {
    cout << solve(e) << endl;
  }
}

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

int main(){
  int E;
  while(cin >> E){
    int min=E;
    int sum;
    for(int z=0;z*z*z<=E;z++){
      if(E-z*z*z>0){
        int t=E-z*z*z;
        int y=(int)sqrt(t);
        int x=t-y*y;
        sum=x+y+z;
      }else if(E-z*z*z==0){
	sum=z;
      }
      if(min>sum) min=sum;
    }
    cout<< sum <<endl;
  }
}