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 <vector>

using namespace std;

int main(){
	vector<int> two, three;
	for (int i = 0; i * i < 1000000; i++) {two.push_back(i*i);}
	for (int i = 0; i * i * i < 1000000; i++) {three.push_back(i*i*i);}

	int e;
	while (cin >> e, e) {
		int tw, th;
		int a = e, b = e;

		for (tw = 0; two[tw + 1] <= a; tw++); 
		a -= two[tw];
		for (th = 0; three[th + 1] <= a; th++);
		a -= three[th];
		a = (tw + th + a);

		for (th = 0; three[th + 1] <= b; th++);
		b -= three[th];
		for (tw = 0; two[tw + 1] <= b; tw++); 
		b -= two[tw];
		b = (tw + th + b);

		if (a > b) cout << b << endl;
		else cout << a << endl;
	}
	return 0;
}

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

int main(){

  int x,y,z;
  int min;
  int e;
  
  //x + y^2 + z^3 = e
  //x = e - y^2 - z^3

  while(cin>>e , e){
    min = 1000000;

    y=0;
    while(y*y <= e){
      z=0;
      while(y*y+z*z*z <= e){
	x = e-y*y-z*z*z;
	if(x+y+z < min){
	  min = x+y+z;
	  //cout << e << '=' << x+y*y+z*z*z << endl;
	}

	z++;
      }
      y++;
    } 

    cout << min << endl;

  }

  return 0;
}

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

int main() {
	int e, ans;
	while ( cin >> e && e != 0 ) {
		ans = 1000000;
		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;
				if ( x + y + z < ans ) ans = x + y + z;
			}
		}
	cout << ans << endl;
	}
}

C++: #include<iostream>
using namespace std;
int x,y,z;
int e;
int solve(){
	int minsum = 1000000;
	for (z=0;z<=e;z++)
	{
		if(z*z*z>e) break;
		for(y=0;y<=e;y++)
		{
			if(y*y+z*z*z>e) break;
				for(x=0;x<=e;x++)
				{
					if(x+y*y+z*z*z == e)
					{
						int temp = x+y+z;
						minsum = min(minsum,temp);
					}
				}
		}
	}
	return minsum;
};
int main(){
	int A[100000];
    int k = 0;
	while( cin>>e && e>0 )
	{
		A[k]=solve();
        k++;
	}
	for(int l = 0;l < k; l++)
    {
        cout<<A[l]<<endl;
    }
	return 0;
}

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

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

		cout << ans << endl;
	}
}

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

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main(){
    int e;
    while(cin >> e, e != 0){
        int minV = 1000000;
        for(int i=0; i<=e; i++){
            for(int j=0; j<=e; j++){
                for(int k=0; k<=e; k++){
                    if(i+j*j+k*k*k == e){
                        minV = min(minV, i+j+k);
                    }
                }
            }
        }
        cout << minV << endl;
    }
    return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<stack>
#include<queue>
#include<string>
#include<string.h>
#include<set>
#include<functional>
using namespace std;

#define INF 1<<21
#define MOD 1000000007

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

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

using namespace std;

int main() {

    int e;

    while(cin >> e, e) {

        int x, y, z, m = e;

        int z_range = floor(pow(e, 1.0 / 3));
        for(z = 0; z <= z_range; ++z) {
            int y_range = floor(sqrt(e - z * z * z));
            for(y = 0; y <= y_range; ++y) {
                m = min(m, (e - y * y - z * z * z) + y + z);
            }
        }

        cout << m << endl;

    }

}

C++: #include<map>
#include<set>
#include<list>
#include<cmath>
#include<queue>
#include<stack>
#include<cstdio>
#include<string>
#include<vector>
#include<complex>
#include<cstdlib>
#include<cstring>
#include<climits>
#include<numeric>
#include<sstream>
#include<iostream>
#include<algorithm>
#include<functional>

#define MP make_pair
#define PB push_back
#define ALL(x) (x).begin(),(x).end()
#define REP(i,n) for(int i=0;i<(n);i++)
#define REP1(i,n) for(int i=1;i<(n);i++)
#define REP2(i,d,n) for(int i=(d);i<(n);i++)
#define RREP(i,n) for(int i=(n);i>=0;i--)
#define CLR(a)      memset((a),0,sizeof(a))
#define MCLR(a)     memset((a),-1,sizeof(a))
#define RANGE(x,y,maxX,maxY) (0 <= (x) && 0 <= (y) && (x) < (maxX) && (y) < (maxY))

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;
typedef vector<int> VI;
typedef vector<VI > VVI;
typedef vector<string> VS;
typedef vector<LL> VLL;
typedef pair<int,int> PII;

const int INF = 0x3f3f3f3f;
const LL INFL = 0x3f3f3f3f3f3f3f3fLL;
const double EPS = 1e-9;

const int DX[]={1,0,-1,0},DY[]={0,-1,0,1};

int main(){
	int x,y,z,e,ee,res=10000000;
	while(1){
		cin >> e;
		if(e==0){
			break;
		}
		for(z=0;z<=100;z++){
			ee=e;
			if(z*z*z<=ee)
				ee-=z*z*z;
			for(y=0;y<=100;y++){
				x=ee;
				if(y*y<=x)
					x-=y*y;
				res=min(res,x+y+z);
			}
		}
		cout << res << endl;
		res=1000000;
	}
	return 0;
}



/*int main(){
	long z,e,ee,res=1000000;
	while(1){
		cin >> e;
		if(e==0)
			break;

		for(int i=0; e!=0;i++){
            if(i*i*i > e){
                z = i;
                break;
            }
        }
        
        for(int i=0; i<20;i++){
            z-=1;
            ee=e;
            if(z<0){
                z=0;
            }
            ee-=z*z*z;
            if(ee==0){
                res=min(res,z);
            }
            for(int y=0;ee!=0;y++){
                if(y*y > ee){
                    ee-=(y-1)*(y-1);
					res=min(res,z+(y-1)+ee);
					break;
				}
            }
		}
        cout << res << endl;
		res=1000000;
	}
	return 0;
}*/

C++: #include <iostream>

using namespace std;

int main() {
	int e,x,y,z,small ;
	z=0;
	small=1000000;
	while(cin >> e && e>0){
		while(z*z*z <= 1000000){
			y = 0 ;
			while(y*y <= 1000000){
				x = e-y*y-z*z*z;
				if(small > x+y+z && x >= 0){
				small = x+y+z;
				}
			y = y+1;
			}
		z = z+1;
		}
	cout << small << endl ;
	}
}

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

int E;

int solve(){
  int ans = 1000000;
  for(int z = 0; z * z * z <= E; ++z){
    int F = E - z * z * z;
    for(int y = 0; y * y <= F; ++y){
      int x = F - y * y;
      ans = min(ans, x + y + z);
    }
  }
  return ans;
}

int main(){
  while(scanf("%d", &E) && E > 0){
    printf("%d\n", solve());
  }
}

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

using namespace std;

int main(){
	int e;
	cin >> e;

	for(int x=0;x<=e;x++){
		for(int y=0;y<=sqrt(e)+1;y++){
			for(int z=0;z<=e/3;z++){
				if(x+y*y+z*z*z == e){
					//cout << x << " " << y << " " << z << endl;
					cout << x+y+z << endl;
					return 0;
				}
			}
		}
	}

	return 0;
}