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;

#define MAX 1000000
int min(int a, int b) {
    if (a > b)
        return b;
    else
        return a;
}
int main()
{
    while (1)
    {
        int y, z, e, ans = MAX;
        cin >> e;
        if (!e)
            break;
        for (z=0; z*z*z <= e; z++) {
            y = (int)sqrt((double)e - z*z*z);
            ans = min(ans, e - y*y - z*z*z + y + z);
        }
        cout << ans << endl;
    }
    return 0;
}

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

using namespace std;

int main() {	
	while (true) {
		int e;
		int ans = 1e+9;
		cin >> e;
		if (e == 0) {
			break;
		}
		
		for (int z = 100; z >= 0; z--) {
			for (int y = 1000; y >= 0; y--) {
				int x;
				if (e >= z * z * z + y * y) {
					x = e - z * z * z - y * y;
					ans = min(ans, x + y + z);
				}
			}
		}
		
		cout << ans << endl;
	}
	
	return 0;
}

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

using namespace std;

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

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

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> VI;
typedef vector<VI> VVI;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const int INF = numeric_limits<int>::max() / 2;
const int NEG_INF = numeric_limits<int>::min() / 2;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);

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

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

int main()
{
	while(true) {

		int e;

		scanf("%d", &e);
		if(e == 0)
			break;

		int m = e;

		for(int z = 0; z * z * z <= e; ++z) {

			int z3 = z * z * z;

			for(int y = 0; y * y + z3 <= e; ++y) {

				int y2 = y * y;
				int x = e - z3 - y2;

				m = min(m, (x + y + z));
			}
		}

		printf("%d\n", m);
	}

	return 0;
}

C++: #include <iostream>
#include<algorithm>
//#include<math.h>
#define MAX 1000000
using namespace std;
void minn(int e)
{
    int t=0;
    int mi[MAX]={0};
    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;
            //cout<<x<<y<<z<<endl;
            mi[t++]=x+y+z;
        }
     sort(mi,mi+t);
     cout<<mi[0]<<endl;
}
int main()
{
    int e;
    while(cin>>e)
    {
        if(e==0)
            break;
        minn(e);
    }
    return 0;
}

C++: #include <stdio.h>
int main(void)
{
  int e,m;
  int i,j,k;
  for(;;)
    {
      scanf("%d",&e);
      m=e;
      if(e==0){break;}
      for(i=0;i<=e;i++)
	{
	  if(i>=m){break;}
	  /*printf("i=%d",i);*/
	  for(j=0;j<=e-i;j++)
	    {
	      if((i+j)>=m){break;}
	      for(k=0;k<=e-j-i;k++)
		{
		  if((i+j+k)>=m){break;}
		  /*printf("%d",k);*/
		  if(i+(j*j)+(k*k*k)==e && i+j+k<m)
		    {
		      m=i+j+k;
		      /*printf("m1=%d\n",m);*/
		    }
		}
	    }
	}
      printf("%d\n",m);
    }
  return 0;
}

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 min = e;

		for (int i = 0; three[i] <= e; i++) {
			for (int j = 0; three[i] + two[j] <= e; j++) {
				if (three[i] + two[j] <= e) {
					if (i + j + (e - three[i] - two[j]) < min) min = i + j + (e - three[i] - two[j]);	
				}	
			}	
		}
		cout << min << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <stdlib.h>
using namespace std;
int main()
{
  int E,z,y,x;
  int min=1000000;
  while (cin >> E && E>0){
    if (E>1000000){
    cout << "Incorrect input" << endl;
    exit(1);
    }
    for (z=0;z*z*z<=E;z++){
      for (y=0;y*y+z*z*z<=E;y++){
	x=E-y*y-z*z*z;
        if(min > x+y+z)
          min=x+y+z;
      }
    }
    cout << min << endl;
  }
}

C++: #include<iostream>
using namespace std;
int main() {
	int e;
	while (scanf("%d", &e), e) {
		int m = 100000000;
		for (int y = 0; y <= 10000; y++) {
			for (int z = 0; z <= 10000; z++) {
				int x=e + y - y * y + z - z * z * z;
					if(x>=0&&e>=y*y+z*z*z)m = min(x,m);
			}
		}
		cout << m << endl;
	}
}

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

int main() {
	int e, m, a, x;
	double c, d;
	while (true) {
		cin >> e;
		if (e == 0) break;
		m = 90000000;

		c = pow(e, 1.0 / 3.0);
		d = sqrt(e);
		for (int z = 0; z <= c + 10; z++) {
			for (int y = 0; y <= d; y++) {	
				x = e - y*y - z*z*z;
				if (x < 0) break;
				else {
					a = x + y + z;
					if (a < m) m = a;
				}
			}
		}

		cout << m << endl;
	}
	return 0;
}

C++: #include "bits/stdc++.h"
#define ALL(a) (a).begin(),(a).end()
#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 debug(x) cout << #x << " : " << (x) << " --------------" << endl;
using namespace std;
struct Point {
    int l;
    int h;
};
bool operator < (const Point& lhs, const Point& rhs) {
    return tie(lhs.l, lhs.h) < tie(rhs.l, rhs.h);
}
int main(void){
    int e;
    while (cin >> e, e) {
        int m = 1000000;
        REP(x, 1000001) {
            if (x > e || x > m) break;
            REP(y, 1001) {
                int tmp = x + y * y;
                if (tmp > e || x + y > m) break; 
                REP(z, 101) {
                    int val = tmp + z * z * z;
                    if (val == e)
                        m = min(m, x + y + z);
                    else if (val > e || x + y + z > m)
                        break;
                }
            }
        }
        cout << m << endl;
    }
    return EXIT_SUCCESS;
}

C++: #include<iostream>
#include<cmath>
using namespace std;
int main()
{
	int e;
	while(cin>>e,e) 
	{
		int m=10000000;
		for(int z = 0; z*z*z <= e; ++z)
		{
			int t=e-z*z*z;
			t=sqrt(t);
			for(int y = 0; y <= t; ++y)
			{
				m=min(m,z+y+(e-z*z*z-y*y));	
			}
		}
		cout<<m<<endl;
	}
  return 0;
}

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

using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
typedef complex<double> P;
static const double EPS = 1e-8;
static const int INF = (int)1e8;

#define FOR(i,k,n) for (int i=(k); i<(int)(n); ++i)
#define REP(i,n) for (int i=0; i<(int)(n); ++i)
#define FOREQ(i,k,n) for (int i=(k); i<=(int)(n); ++i)
#define FORIT(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define FIND(m,w) ((m).find(w)!=(m).end())

int main(void){
  int e;
  while(cin>>e,e){
    int my = sqrt(e);
    int mz = pow(e,1.0/3.0);
    int ans = INF;
    for(int y = 0; y<=my; y++){
      for(int z = 0; z<=mz; z++){
        int x = e - y*y - z*z*z;
        if(x<0) break;
        ans = min(ans,x+y+z);
      }
    }
    cout<<ans<<endl;
  }
  return 0;
}