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, e) {
        int min_a = 1000000;
        int z_, y_;

        for (int z = 0; z * z * z <= e; z++)
            for (int y = 0; y * y + z * z * z <= e; y++) {
                if (min_a > z + y + e - y * y - z * z * z)  {
                    min_a = z + y + e - y * y - z * z * z;
                    z_ = z;
                    y_ = y;
                }
            }
        cout << e - y_ * y_ - z_ * z_ * z_ + y_ + z_ << endl;
    }

    return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<numeric>
#include<vector>
#include<set>
#include <math.h>
#include <string>
#define cinf(n,x,y) for(int i=0;i<(n);i++) cin >> x[i]>>y[i];
typedef long long int ll;
const ll INF =1LL << 62;
using namespace std;
int MAX_E=1000010;
ll dp[1000010];
int main(){
	while(1){
		int e; cin >>e;
		if(e==0) break;
		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;
	}
}

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

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

C++: // 2016-12-05
#include <iostream>
#include <cmath>
using namespace std;

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

C++: #include <iostream>
#include <cmath>
using namespace std;
using ll = long long;
int main(void){
	while(1){
		ll num,ans=1000000;
		cin >> num;
		if(!num)	break;
		for(ll x=0;x<=100;x++){
			for(ll y=0;y<=100;y++){
				for(ll z=0;z<=100;z++){
					ll kazu=x+pow(y,2)+pow(z,3);
					if(kazu>num)	break;
					if(kazu==num){
						//cout << x << ' ' << y << ' ' << z << endl;
						ans = min(ans,(x+y+z));
						break;
					}
				}
			}
		}
		cout << ans << endl;
}
	return 0;
}

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

using namespace std;

#define LOG(...) fprintf(stderr, __VA_ARGS__)
//#define LOG(...)
#define FOR(i, a, b) for(int i = (int)(a); i < (int)(b); ++i)
#define REP(i, n) for(int i = 0; i < (int)(n); ++i)
#define RREP(i, n) for(int i = (int)(n - 1); i >= 0; --i)
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define EXIST(s, e) ((s).find(e) != (s).end())
#define SORT(c) sort(ALL(c))
#define RSORT(c) sort(RALL(c))
#define SQ(n) (n) * (n)

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<pii> vpi;
typedef vector<pll> vpl;
typedef vector<ll> vll;
typedef vector<vb> vvb;
typedef vector<vi> vvi;
typedef vector<vc> vvc;
typedef vector<vll> vvll;

int main() {
  int e;
  while(cin >> e, e) {
    int res = (int)1e9;
    for(int z = 0; z * z * z <= e; z++) {
      for(int y = 0; z * z * z + y * y <= e; y++) {
        int x = e - (z * z * z + y * y);
        res = min(res, z + y + x);
      }
    }
    cout << res << endl;
  }
}

C++: #include <iostream>
#define INF 999999999

using namespace std;

int main(void){

  int e;
  while( cin >> e , e ){

    int ans = INF;
    for( int a = 0 ; a*a*a <= e ; a++ ){
      for( int b = 0 ; b*b + a*a*a <= e ; b++ ){
	ans = min( ans , e - a*a*a - b*b + b + a ); 
      }
    }
    cout << ans << endl;
  }
  return 0;
}

C++: #define _CRT_SECURE_NO_WARNINGS // #pragma warning(disable:4996)
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <functional>
#include <sstream>
#include <cmath>
#include <set>
#include <map>
#include <stack>
using namespace std; 

#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define pb push_back
#define mp(a,b) make_pair(a,b)
#define all(a) a.begin(),a.end()
#define len(x) ((int)(x).size())
#define tmax(a,b,c) max((a),max((b),(c)))
#define tmin(a,b,c) min((a),min((b),(c)))
#define debug(x) cerr << #x << " is " << x << endl;

typedef pair<int, int> Pii;
typedef vector<int> Vi;
typedef vector<vector<int> > VVi;
typedef long long ll;
const int inf = 2e9;
const ll ll_inf = 1e17;
const int mod = 1e9 + 7;
const long double eps = 1e-10;

int main()
{
	while (1) {
		int e;
		cin >> e;
		if (!e) break;
		int ans = inf;
		rep(i, 0, 1001) {
			rep(j, 0, 1001) {
				int l = 0;
				int r = 1000;
				rep(k, 0, 20) {
					int m = (l + r) / 2;
					int x = i*i*i + j*j + k;
					if (x == e) {
						ans = min(ans, i+j+k);
					}
					else if (x > e) r = m;
					else l = m;
				}
			}
		}
		cout << ans << endl;
	}

	return 0;
}

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

using namespace std;

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

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

using namespace std;

int main(){
	int e,m;
	int dp[1000001];
	dp[0] = 0;
	for (int i = 1; i < 1000001; i++) dp[i] = 1000000;
	for (int i = 2; (int)pow(i, 3) < 1000000; i++){
		dp[(int)pow(i, 3)] = min(i,dp[(int)pow(i,3)]);
	}
	for (int i = 2; (int)pow(i, 2) < 1000000; i++){
		dp[(int)pow(i, 2)] = min(i,dp[(int)pow(i,2)]);
	}
	for (int i = 0; i < 1000001; i++){
		dp[i] = min(dp[i - 1] + 1, dp[i]);
	}
	while (cin >> e, e){
		cout << dp[e] << endl;
	}
	return 0;
}

C++: #include<cstdio>

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

int main(){
    while(1){
        int e;
        scanf("%d",&e);
        if(e==0) return 0;
        printf("%d\n",solve(e));
    }
}

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

using namespace std;

#define REP(i,n) for(int i = 0;i < n;i++)
	
int e,r,t;
int main()
{
	while(cin >> e,e)
	{
		int z;r = 1e9;
		for(int z = 0;z*z*z <= e;z++)
		{
			t = sqrt(e-z*z*z);
			r = min(r,e-z*z*z-t*t+t+z);
		}
		
		cout << r << endl;
		
	}
	
	return 0;
}