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<string.h>
#include<string>
#include<cstdio>
#include<stdlib.h>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#include<set>
#define ll long long int
#define ld long double
#define INF 1000000000
#define EPS 0.0000000001
#define rep(i,n) for(i=0;i<n;i++)
using namespace std;
typedef pair<int, int> pii;

int main()
{
  int e;

  while(1){
    cin>>e;
    if(e==0)break;
    int ans=INF;
    int x,y,z;
    rep(z,e+1)
      rep(y,e-z*z*z+1){
        x=e-z*z*z-y*y;
	ans=min(ans,x+y+z);
      }
    cout<<ans<<endl;
  }

}

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

int main(){
  int e;
  while(1){
    cin>>e;
    if(e==0)break;
    int m1=0,m=10000000;
    for(int i=0;i<=e;i++)
      for(int j=0;j<=(e-i);j++)
	for(int k=0;k<=(e-i-j);k++)
	  if(e==i+(j*j)+(k*k*k)){
	    m1=i+j+k;
	    if(m>m1)m=m1;
	  }
    cout<<m<<endl;
  }
  return 0;
}

C++: #include <iostream>

using namespace std;

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

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <cmath>
#include <string>
#include <sstream>
#include <iomanip>
#include <complex>
using namespace std;
 
#define ll long long
#define vvi vector< vector<int> >
#define vi vector<int>
#define All(X) X.begin(),X.end()
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define pb push_back 
#define pii pair<int,int>
#define mp make_pair
#define pi 3.14159265359
#define shosu(X) fixed << setprecision(X)
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

int hoge(int e){
  int num;
  int a,b,c;
  for(a=0;a<=e;a++){
	for(b=0;b<=1000;b++){
	  for(c=0;c<=100;c++){
		num = a + b*b + c*c*c;
		//		cout << num << endl;
		if(num > e) break;
		if(num == e) return (a + b + c);
		
	  }
	}
  }  
	return -1;
}

int main(){

  int e;

  while(1){
	cin >> e;
	if(e==0) break;

	cout << hoge(e) <<endl;

  }
}

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

using namespace std;

int e;

void solve() {
	int m = e;
	
	for (int x = 0; x <= e; x++) {
		for (int y = 0; y * y <= e; y++) {
			for (int z = 0; z * z * z <= e; z++) {
				if (x + y * y + z * z * z == e) {
					m = min(m, x + y + z);
				}
			}
		}
	}
	
	cout << m << endl;
}

int main() {
	while (1) {
		cin >> e; if (e == 0) break;
		solve();
	}
	
	return 0;
}

C++: #include <bits/stdc++.h>
#define int long long
#define main signed main()
// #define main int main()
#define bye return 0
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)
#define stlice(from, to) substr(from, (to) - (from) + 1)
#define min(...) min({__VA_ARGS__})
#define max(...) max({__VA_ARGS__})
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
using namespace std;
template<typename A, typename B> bool cmin(A &a, const B &b) { if (a > b) { a = b; return true; } else return false; }
 
main {
  int e;
  while(cin>>e,e){
    int m=1000000000;
    rep(z,101) rep(y, 1001) {
      int x=e-z*z*z-y*y;
       if (x>=0) cmin(m,x+y+z);
     }
    cout<<m<<endl;
  }
  bye;
}

C++: #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
const int INF = 1000000000;
#define REP(i,s,n) for(int i=(int)(s);i<(int)(n);i++)
#define rep(i,n) REP(i, 0, n)
int main(){
    for(int n; cin >> n && n; ){
        int ans = INF;
        for(int z = 0; z * z * z <= n; z++)
          for(int y = 0; y * y + z * z * z <= n; y++){
              int x = n - (y * y + z * z * z);
              ans = min(ans, x + y + z);
          }
        cout << ans << endl;
    }
    return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <cstdio>
#include <string>
#include <cstring>
#include <cctype>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <set>
#include <queue>
#include <stack>
#include <map>
using namespace std;

#define REP(i, s, e) for (int i = (s); i < (e); i++)
#define REPI(i, s, e) for (int i = (s); i <= (e); i++)
#define rep(i, n) REP(i, 0, n)
#define repi(i, n) REPI(i, 0, n)
#define ALL(v) (v).begin(), (v).end()

#define dump(x) (cout << #x << " = " << x << endl)
#define dump2(x, y) (cout << "(" << #x << ", " << #y << ") = (" << x << ", " << y << ")" << endl)
#define dump3(x, y, z) (cout << "(" << #x << ", " << #y << ", " << #z << ") = (" << x << ", " << y << ", "<< z << ")" << endl)

typedef long long ll;
typedef pair<int, int> pii;

int main(void)
{
	int e;
	while (cin >> e, e) {
		int ans = (1<<29);
		for (int x = 0; x < max(e/3+1, 2); x++) {
			for (int z = 0; z < max(e/3+1, 2); z++) {
				int t = sqrt(e-x-z*z*z);
				for (int y = t-1; y <= t+1; y++)
					if (x+y*y+z*z*z == e)
						ans = min(ans, x+y+z);
			}
		}
		cout << ans << endl;
	}
	return 0;
}

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

int main(){
    int e;

    while(cin>>e,e){
        int res=10000000;
        for(int z=100;z>=0;z--){
                for(int y=1000;y>=0;y--){
                    int x=e-z*z*z-y*y;

                    if(x>=0){
                        res=min(res,x+y+z);
                    }
                }
        }

        cout << res << endl;
    }
}

C++: #include <iostream>
#include <math.h>
using namespace std;
int main(){
  int e = 1;
  while(1){
    int z = 0, y = 0, x = 0;
    int min_m = 1000000000;
    cin >> e;
    if(e == 0) break;
    //    cout << "e: " << e << endl;
    while( e - pow(z,3) >= 0){
      y = 0;
      while( e - pow(y, 2) - pow(z,3) >= 0){
	x = e - pow(y,2) - pow(z,3);
	int m = x + y + z;
	// cout << "x" << x << "y" << y << "z" << z << endl;
	if (m < min_m){
	  min_m = m;
	}
	y++;
      }
      z++;
    }
    cout << min_m << endl;
  }
}

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

int main(){
	int a;
	while(cin>>a,a){
		int x=INF;
		int y=INF;
		int z=INF;
		
		for(int i=0;i*i*i<=a;i++){
			int d,e,f;
			int b=a;
			b-=(i*i*i);
			d=i;
			int c=sqrt(b);
			e=c;
			b-=(c*c);
			f=b;
			if(d+e+f<x+y+z){
				z=d;
				y=e;
				x=f;
				}
			}
			cout<<x+y+z<<endl;
		}
		return 0;
	}

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

const int MAX_E=1e6+10;

int e,ans;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    while(cin >> e,e){
        ans=MAX_E;
        for (int z=0;z*z*z<=e;++z)
            for (int y=0;y*y+z*z*z<=e;++y)
                ans=min(ans,(e-y*y-z*z*z)+y+z);
        cout << ans << '\n';
    }
}

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

int max(int a, int b)
{
    return a > b ? a : b;
}

int main() {

    int e=0, min, tre, deu;
    while(cin >> e && e > 0)
    {
        min = e;
        for(int i = max(e/8, 1); i>=0;i--)
        {
            tre = i*i*i;
            if(tre <= e)
                for(int j = max(e/2, 1);j>=0;j--)
                {
                    deu = j*j;
                    if(deu <= e - tre)
                        min = i + j + (e-tre-deu) < min ? i+j+(e-tre-deu) : min;
                }
        }
        cout << min << endl;
    }
    return 0;
}