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 n;
    while(cin >> n, n){
        int ans = 1000000;
        for(int i=0; i < 100; i++){
            int j = sqrt(n-pow(i, 3));
            if(n < pow(i, 3) + pow(j, 2)) continue;
            ans = min(ans, i+j+(int)(n-pow(i, 3)-pow(j, 2)));
        }
        cout << ans << endl;
    }
}

C++: #include <iostream>

using namespace std;

int main(){
    int e;
    while(cin >> e, e){
        int m = e;
        for(int z=0; z<m && z*z*z<=e; ++z){
            for(int y=0; y+z<m && y*y+z*z*z<=e; ++y){
                int x = e - z*z*z - y*y;
                if(x + y + z < m)m = x + y + z;
            }
        }
        cout << m << '\n';
    }
    return 0;
}

C++: #include <iostream>

using namespace std;

const int INF = 114514810;

int main(void) {
    int e;
    while(cin >> e and e) {
        int ans = INF;
        for(int z = 0; z*z*z <= e; z++)
            for(int y = 0; y*y <= e - z*z*z; y++) 
                ans = min(ans, e + y + z - y*y - z*z*z);

        cout << ans << endl;
    }

    return 0;
}

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


int main(){
	int e;
	int tri[101];
	for(int i=0;i<=100;i++)tri[i]=i*i*i;
	int db[1001];
	for(int i=0;i<=1000;i++)db[i]=i*i;
	
	while(cin>>e,e){
		int ans=e;
		for(int i=100;i>=0;i--){
			for(int j=1000;j>=0;j--){
				int t=tri[i]+db[j];
				if(e>=t){
					ans=min(ans,e-t+i+j);
				}
			}
		}
		cout<<ans<<endl;
	}
	
	return 0;
}

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

int main () {
  long long int e;
  cin >> e;
  long long int min = 0;
  for (long long int i = 0; i < e+1; i++) {
    for (long long int k = 0; k < round(sqrt(e)); k++) {
      for (long long int l = 0; l < round(pow( e,  1.0/3.0 )); l++) {
        if (i + k*k + l*l*l == e) {
          if (min == 0) {
            min = i + k + l;
          } else if (min > i + k + l) {
            min = i + k + l;
          }
        }
      }
    }
  }
  cout << min << endl;
}

C++: #include <iostream>
#include<algorithm>
using namespace std;
 
int main() {
    for(;;){
        int e;
        int ans=1000000;
        cin >> e;
        if (e==0) {
            break;
        }
        for (int z=0;e-z*z*z>=0 ; z++) {
            for (int y=0; e-z*z*z-y*y>=0; y++) {
                ans=min(ans,e-z*z*z-y*y +y+z);
            }
        }
        cout<<ans<<"\n";
    }
}

C++: #include<iostream>

using namespace std;

int main(){
  int e;
  int minimum = 10000000, n= 0;
  while(1){
    minimum = 10000000;
    cin >> e;
    if(e == 0) break;
    for(int i = 0; i<100; i++){
      for(int j = 0; j<1000; j++){
	n = e - i*i*i -j * j;
	if(n+ i+ j < minimum && n>= 0) minimum = n+ i+ j;
      }
    }
    cout << minimum << endl;
  }
  return 0;
}

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

#define REP(i, n) for(int i = 0; i < (int) (n); i++)
#define ALL(v) (v).begin(), (v).end()
#define INF 1e9

int main(){
  int e;
  while(cin >> e and e){
    int res = INF;
    REP(i, 105){
      int ne = e;
      if(pow(i, 3) > ne) break;
      ne -= pow(i, 3);
      REP(j, 1005){
        int nne = ne;
        if(pow(j, 2) > nne) break;
        nne -= pow(j, 2);
        res = min(i + j + nne, res);
      }
    }
    cout << res << endl;
  }
  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
int main() {
    int e;
    while(scanf("%d",&e),e) {
        int ans=1<<30;
        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;
                ans=min(ans,x+y+z);
            }
        }
        printf("%d\n",ans);
    }
}

C++: #include <stdio.h>
#include <vector>

using namespace std;
int solve(int e)
{
    int minsum=10000000;
    for(int z=0;z*z*z<=e;z++)
    {
        for(int y=0,lim=e-z*z*z;y*y<=lim;y++)
        {
            int x=e-y*y-z*z*z;
            if(minsum>x+y+z)
            {
                minsum=x+y+z;
            }
        }
    }
    return minsum;
}
int main(void)
{
    int e;
    while(scanf("%d",&e)==1 && e)
    {
        printf("%d\n",solve(e));
    }
    return 0;
}

C++: #include<stdio.h>

int main(){
	long long E, sum=1000000;
	int y,z;
	long long x= E-z*z*z-y*y;
	while(scanf("%lld",&E),E){
	if(E==0)break;
	for(z=0;z*z*z<=E;z++)
		for(y=0;y*y<=E;y++){
			if(z*z*z+y*y>E)break;
			else if(sum>x+y+z)sum=x+y+z;
			}
		printf("%lld\n",sum);
	}
        return 0;
}

C++: #include<bits/stdc++.h>
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
#define pb push_back
int dy[]={0, 0, 1, -1, 1, 1, -1, -1};
int dx[]={1, -1, 0, 0, 1, -1, -1, 1};

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#define mp make_pair
#define fi first
#define sc second
ll e;
int main(){
	while(1) {
		cin >> e;
		if(e == 0) 
			break;


		ll ans = 1000000000000;
		for(ll z = 0;z * z * z <= e;z++) {
			for(ll y = 0; y * y <= e - z * z * z;y++) {
				ll x = e - z * z * z - y * y;
				if(x >= 0) {
					ans = min(ans,x + y + z);
				}
			}
		}
		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;
				int x = i*i*i + j*j;
				if (x > e) continue;
				rep(k, 0, 10) {
					int m = (l + r) / 2;
					if (x+k == e) {
						ans = min(ans, i+j+k);
					}
					else if (x+k > e) r = m;
					else l = m;
				}
			}
		}
		cout << ans << endl;
	}

	return 0;
}

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

int e = 0;

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

    int z_max;
    int res = INT_MAX;
    for(y=0; y<=e; ++y){
        if((e-y*y) < 0){
            break;
        }
        z_max = pow(e-y*y, 1.0/3.0) + 1;
        for(z=0;z<=z_max;++z){
            x = e - y*y - z*z*z;
            if(x >= 0){
               res = std::min(res, x+y+z);
            }else{
                break;
            }
        }
    }
    return res;
}

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