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<bits/stdc++.h>
using namespace std;
 
int main(){
  int e,ans;
  while(1){
    cin>>e;
    if(!e)break;
    ans=(1e9);
    for(int z=0;z*z*z<=e;z++){
      int Z=z*z*z;
      for(int y=0;y*y<=e-Z;y++){
    int Y=y*y;
    int X=e-Y-Z;
    if(X+Y+Z!=e)continue;
    ans=min(ans,X+y+z);
      }
    }
    cout<<ans<<endl;
  }
  return 0;
}

C++: #include<stdio.h>

int main(){
	long long E, sum=1000000;
	int y,z;
	while(scanf("%lld",&E),E){
	if(E==0)break;
	for(z=0;z*z*z<=E;z++)
		for(y=0;y*y<=E;y++){
            long long x= E-z*z*z-y*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 <iostream>
#include <cstdio>
#include <iomanip>

#include <vector>
#include <map>
#include <set>
#include <queue>
#include <bitset>
#include <stack>
#include <utility>

#include <numeric>
#include <algorithm>
#include <functional>

#include <cctype>

#include <complex>
#include <string>
#include <sstream>

using namespace std;

#define all(c) c.begin(),c.end()
#define rall(c) c.rbegin(),c.rend()
#define rep(i,n) for(unsigned int i=0;i<(n);i++)
#define tr(it,container) for(typeof(container.begin()) it = container.begin(); \
                                                  it != container.end(); ++it)
#define mp(a,b) make_pair((a),(b))

typedef long long ll;
typedef complex<double> P;
const int dx[] = {1,0,-1,0};
const int dy[] = {0,-1,0,1};
const double EPS = 1e-9;
const int days[] = {31,28,31,30,31,30,31,31,30,31,30,31};
const int daysleap[] = {31,29,31,30,31,30,31,31,30,31,30,31};

int main(){
    while(true){
        int e;
        cin >> e;
        if(e==0) break;
        int m = 10000001;
        for(int z=0;z<=100;z++){
            int xy2 = e - pow(z,3);
            if(xy2 < 0) break;
            for(int y=0;y*y <= xy2;y++){
                int x = xy2 - y*y;
                m = min(x+y+z,m);
            }
        }
        cout << m << endl;
    }
    return 0;
}

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

int memo[1000001][3];

int dp(int a, int b) {
  if(memo[a][b]) {
    return memo[a][b];
  }

  int ret = 1000111000;

  switch(b) {
    case 0:
      for(int i=0; i*i*i<=a; i++) {
        ret = min(ret, dp(a-i*i*i, 1)+i);
      }
      memo[a][b] = ret;
      break;

    case 1:
      for(int i=0; i*i<=a; i++) {
        ret = min(ret, dp(a-i*i, 2)+i);
      }
      memo[a][b] = ret;
      break;

    case 2:
      ret = a;
      memo[a][b] = ret;
      break;
  }

  return ret;
}

int main() {

  int m;
  while(cin >> m, m) {
    cout << dp(m, 0) << endl;
  }

  return 0;
}

C++: 

int main(){

  while(true){
    int min;
      
    cin >> e;
    min = e;
    
    if(e == 0)break;
    for (int x = 0; x <= e; ++x){
       for (int y = 0; y <= e; ++y){
	  for (int z = 0; z <= e; ++z){
	    if((x + y*y + z*z*z) == e){
	      if((x + y + z) <= min)min = x + y + z;
	      //cout << "xyz = " << x << " " << y << " " << z << " min = " << min << endl;
	    }
	  }
       }
    }
    cout << min << endl;
    
  }
}

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 ans = e;
    for(int z = 0; z*z*z<=e; z++){
      for(int y = 0; y*y+z*z*z<=e; y++){
        int x = e - y*y - z*z*z;
        ans = min(ans,x+y+z);
      }
    }
    cout<<ans<<endl;
  }
  return 0;
}

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


int main() {
	int e;
	while (cin >> e && e>0) {
		int y=0;
		int z=0;
		int sum=0,summin=e; // min: NOTICE how we initialize it

		while (y*y*y+z*z*z<e) { // third power of something
			while (y*y*y+z*z*z<e) {
				x= e-y*y*y+z*z*z;	
				sum = x+y+z;
				if (sum < summin) summin = sum;
				++z;
			}
			++y;
		}
		cout << summin << endl;
	}

	return 0;
}

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

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

C++: #include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <stack>
#include <deque>
#include <queue>
#include <set>
#include <cmath>
#include <algorithm>
#include <map>

using namespace std;

#define MAX 1000000
typedef pair<int, int> P;

int main(void) {
	while(1) {
		int e, y, z, ans = MAX;

		scanf("%d", &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);
		}
		printf("%d\n", ans);
	}
	return 0;
}

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

#define REP(i,a,n) for(i=a; i<n; i++)
#define rep(i,n) REP(i,0,n)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define foreach(it,x) for(typeof(x.begin()) it=x.begin(); it!=x.end(); it++)


int main(){
    int e,x,y,z;
    int res;

    while( cin >> e, e ){
        res = INT_MAX;
        for(z=0; z*z*z <= e; z++){
            for(y=0; y*y + z*z*z <= e; y++){
                x = e - z*z*z - y*y;
                res = min(res, x + y + z);
            }
        }
        printf("%d\n",res);
    }

    return 0;
}

C++: #include "bits/stdc++.h"

using namespace std;

const int INF = numeric_limits<int>::max() / 2;

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

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

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

int e,minimum;

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

int main(){
    while(cin >> e && e!=0){
        cout << solve() << endl;
    }
}

C++: #include <cstdio>

void aizu(int e){
    int x, y, z;

    for(int xyz = 1; xyz <= e; xyz++){
        for(x = 0; x <= xyz; x++){
            for(y = 0; x + y <= xyz; y++){
                z = xyz - x - y;
                if(x + y * y + z * z * z == e){
                    printf("%d\n", xyz);
                    return;
                }
            }
        }
    }
}

int main(void)
{
    for(int e = 1; scanf("%d", &e), e != 0;){
        aizu(e);
    }
    return 0;
}