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 <cstdio>
#include <cstdlib>
#include <time.h>
#include <math.h>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <iterator>
#include <sstream>
#include <string>
#include <bitset>
using namespace std;
#define FOR(I,F,N) for(int I = F; I < (int)(N); I++)
#define rep(i, n) FOR(i, 0, n)
#define FIN(V) cout<<V<<endl
#define pb push_back
#define INF (1 << 28)

template<typename T>
void remove(vector<T>& vector, unsigned int index){
vector.erase(vector.begin() + index);
}

typedef pair<int, int> P;
typedef long long ll;
typedef priority_queue<int> pq;
int StrToInt(string);
string IntToStr(int);
int dx[4] = {1, -1, 0, 0};
int dy[4] = {0, 0, 1, -1};

int main(void){

  int e;
  while (cin >> e, e) {
    int min = 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;
        if (x + y + z < min) { min = x + y + z; }
      }
    }
    cout << min << endl;
  }

	return 0;
}



int StrToInt(string s){
	stringstream ss;
	ss << s;
	int val;
	ss >> val;
	return val;
}
string IntToStr(int i){
	stringstream ss;
	ss << i;
	return ss.str();
}

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

int main(void){
	int n;

	while(cin>>n && n){
		int m = 10000000;

		for(int z=0;z*z*z<=n;z++){
			for(int y=0;z*z*z+y*y<=n;y++){
				m = min(z+y+(n-z*z*z-y*y), m);
			}
		}
		cout<<m<<endl;
	}

	return 0;
}

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

typedef long long int ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pair<int, int> > vii;
#define rrep(i, m, n) for(int (i)=(m); (i)<(n);  (i)++)
#define erep(i, m, n) for(int (i)=(m); (i)<=(n); (i)++)
#define  rep(i, n)    for(int (i)=0; (i)<(n);  (i)++)
#define rrev(i, m, n) for(int (i)=(n)-1; (i)>=(m); (i)--)
#define erev(i, m, n) for(int (i)=(n); (i)>=(m); (i)--)
#define  rev(i, n)    for(int (i)=(n)-1; (i)>=0; (i)--)
#define vrep(i, c)    for(__typeof((c).begin())i=(c).begin(); i!=(c).end(); i++)
#define  ALL(v)       (v).begin(), (v).end()
#define pb            push_back
template<class T, class S> inline pair<T, S> mp(T x, S y){ return make_pair(x, y); }
template<class T, class S> inline bool minup(T& m, S x){ return m>(T)x ? (m=(T)x, true) : false; }
template<class T, class S> inline bool maxup(T& m, S x){ return m<(T)x ? (m=(T)x, true) : false; }

static const int    INF = 1000000000;
static const ll     MOD = 1000000007LL;
static const double EPS = 1E-12;

int e;

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

  return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int e,x,y,MIN,i,j;
int main(){
	while(true){
		MIN=1<<31;
		cin>>e;if(!e){break;}
		x=pow(e,0.5);
		y=pow(e,0.334);
		for(i=0;i<=y;i++){
			for(j=0;j<=x;j++){
				MIN=min(MIN,x+y+e-(i*i*i+j*j));
			}
		}
		cout<<MIN<<endl;
	}
}

C++: #include <stdio.h>
#include <math.h>
#define min(a,b) a > b ? b : a

int main(void){
	int y, z, e, m;
	while(1){
		scanf("%d",&e);
		if(e == 0)
			break;
		m = 0x7FFFFFFF;
		for(z = 0;pow((double)z,3) <= e;z++){
			for(y = 0;pow((double)y + 1,2) <= e - pow((double)z,3);y++);
				m = min((int)(z + y + (e - pow((double)z,3) - pow((double)y,2))),m);
		}
		printf("%d\n",m);
	}
	return 0;
}

C++: #include <iostream>
#include <string>
#include <algorithm>
#include <queue>
#include <stack>
#include <map>
#include <vector>
#include <cstdio>
#include <cmath>
#include <cctype>
#define INF 1000000000
using namespace std;
bool debug=false;

int main(){
    int n;
    while(1){
        cin>>n;
        if(n==0)break;
        bool ok=false;
        long long ans=INF;
        for(int i=0;i<=1000;i++){
            for(int j=0;j<=1000;j++){
                for(int k=0;k<=100;k++){
                    if(i+j*j+k*k*k==n){
                        if(ans>i+j+k)ans=i+j+k;
                    }
                }
            }
        }
        cout<<ans<<endl;
    }
    return 0;
}

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

int main() {
  int e;
  while (cin >> e, e != 0) {
    int m = 1000000;
    for (int x = 0; x <= e; x++) {
      for (int y = 0; y * y <= e; y++) {
	for (int z = 0; z * z <= e; z++) {
	  if (x + y * y + z * z * z == e) {
	    m = min(m, x + y + z);
	    break;
	  }
	}
      }
    }

    cout << m << endl;
  }

  return 0;
}

C++: #include <iostream>
#include <math.h>
using namespace std;
int main() {
int e;
int x,y,z;
int sum=0;
while(1){
cin>>e;
if(e==0) break;
for (z=int(cbrt(e));z>0;z--){
  y=int(sqrt(e-z*z*z));
  x=e-y*y-z*z*z;
  if(sum>x+y+z||sum==0){
    sum=x+y+z;
  }
}
cout<<sum<<endl;
}
}

C++: #include <cstdio>
#include <iostream>
#include <cmath>
#include <cstring> 
#include <algorithm>

using namespace std;

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

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

bool solve(){
    int e, m;
    cin >> e;
    if(e == 0) return false;
    m = e;
    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;
            m = min(m, x+y+z);
        }
    }
    cout << m << endl;
    return true;
}

int main(){
    while(solve());
    return 0;
}

C++: #include<bits/stdc++.h>
#define rep(i,n) for(int i=0; i<n; i++)
#define INF 100000000
using namespace std;
int main(){
  int e;
  while(1){
    cin >> e;
    if(e==0) break;
    int ans = INF;
    for(int y=0; y<1000; y++){
      for(int z=0; z<1000; z++){
	int x = e-y*y-z*z*z;
	if(x<0) continue;
	ans = min(ans,x+y+z);
      }
    }
    cout << ans << endl;
  }
  return 0;
}

C++: #include <iostream>
#include <math.h>

#define FOR(i,l,n) for(int (i)=(l);(i)<(n);(i)++)
#define REP(i,n) FOR(i,0,n)

#define MAX_Y 1000
#define MAX_Z 100
using namespace std;

int main(){
    long int x,y,z,e,m=1000000;
    while(cin>>e,e){
        FOR(y,1,pow(y,1/2)){
            FOR(z,1,pow(z,1/3)){
                x = e-pow(z,3)-pow(y,2);
                if(x>=0&&x+y+z<m)m=x+y+z;
            }
        }
        cout<<m<<endl;
    }
    return 0;
}

C++: #include <iostream>
#include<algorithm>
#include<math.h>
#define MAX 1000000
using namespace std;
void minn(int e)
{
    int t=0;
    long int mi[MAX]={0};
    for(int z=0;z<=pow(e,1.0/3);z++)
        for(int y=0;y<=pow(e-z*z*z,1.0/2);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<iostream>
using namespace std;

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