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<algorithm>	
#define rep(i,a) for(int i=0;i<a;i++) 
using namespace std;
const int inf=1e8;
int main(){
	int n;
	while(cin>>n,n){
		int mi=inf;
		rep(i,110)rep(j,1010)mi=min(mi,(n<i*i*i+j*j?inf:i+j+n-i*i*i-j*j));
		cout<<mi<<endl;
	}
}

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

int main(){
  int E;
  while(cin >> E){
    if(E==0) break;
    int min=E;
    int sum;
    for(int z=0;z*z*z<=E;++z){
      int y=sqrt(E-z*z*z);
      int x=E-z*z*z-y*y;
      sum=x+y+z;     
      if(min>sum) min=sum;
    }
    cout<< min <<endl;
  }
  return 0;
}

C++: #include <bits/stdc++.h>
#define REP(i,n) for (int i=0;i<(n);i++)
#define ALL(a) (a).begin(),(a).end()
#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 ll long long
#define ull unsigned long long
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

using namespace std;


int main(){
  int e;
  while(cin>>e,e){
    vector<int> dp(e+1,e);
        for(int i = 0;i*i*i<=e;i++){
	  int zzz = i*i*i;
	  dp[zzz] = min(i,dp[zzz]);
	  for(int j = 0;zzz+j*j<=e;j++){
	    int yy = j*j;
	    dp[zzz+yy] = min(i+j,dp[zzz+yy]);
	    for(int k = 0;zzz+yy+k<=e;k++)
	      dp[zzz+yy+k] = min(i+j+k,dp[zzz+yy+k]);
	  }
	}
  	cout << dp[e] << endl;
  }
  return 0;
}

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

using namespace std;
using LL = long long;
using P = pair<int, int>;
using Tapris = tuple<int, int, int>;

#define REP(i, n) for(LL i = 0; i < n; ++i)
#define FOR(i, a, n) for(LL i = a; i < n; ++i)
#define pb(a) push_back(a)
#define all(x) (x).begin(),(x).end()

const int INF = (int)1e9;
const LL INFL = (LL)1e15;
const int MOD = 1e9 + 7;

int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

//#define int long long

/*************** using variables ***************/
int e;
int m = INF;
/**********************************************/

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

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

        cout << m << endl;
    }
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int e,min;
  while(cin >> e && e){
    if(e == 1)cout << 1 << endl;
    else{
      min = 1000001;
      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){
	      if(min > i + j + k)min = i+j+k; 
	    }
	  }
	}
      }
      cout << min << endl;
    }
  }
}

C++: #include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<iostream>
#include<math.h>
using namespace std;
  
int main(){
	
	while(1){
		long int e,m,i,j,x,y,z;
		cin>>e;
		if(e==0){break;}
		m=e;
		for(i=(int)floor(pow((double)e,1.0/3.0));i>=0;i--){
			z=i;
			for(j=(int)floor(sqrt((double)e-z*z*z));j>=0;j--){
				y=j;
				x=e-z*z*z-y*y;
				if(m>x+y+z){
					m=x+y+z;
				}
			}
		}
		cout<<m<<endl;
	}	
    return 0;
}

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

int main(void){

  int e;

while(1){
    int ans = 1000000;
    cin >> e;
    if(e == 0) break;
    for(int x=0; x <= 300; x++){
      for(int y=0; y <= 172; y++){
	for(int z=0;z <= 99; z++){
	  if(e == x + y*y + z*z*z){
	    ans = min(ans,x+y+z);
	    //cout << x << ' ' << y << ' ' << z << endl;
	  }
	}
      }
    }

    cout << ans << endl;

 }
  return 0;
}

C++: #define _USE_MATH_DEFINES
#define INF 0x3f3f3f3f
#include <cstdio>
#include <iostream>
#include <sstream>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>
#include <list>
#include <cctype>
#include <utility>
 
using namespace std;
 
typedef long long ll;
typedef pair <int,int> P;
typedef pair <int,P > PP;
 
static const int tx[] = {0,1,0,-1};
static const int ty[] = {-1,0,1,0};
 
static const double EPS = 1e-8;

int main(){
  int e;
  while(~scanf("%d",&e)){
    if(e==0) break;
    int res = INF;

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

C++: #include <bits/stdc++.h>
#define ll long long
#define INF 1000000005
#define MOD 1000000007
#define EPS 1e-10
#define rep(i,n) for(int i=0;i<(int)n;++i)
#define each(a, b) for(auto (a): (b))
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define pb push_back
#define show(x) cout <<#x<<" = "<<(x)<<endl
#define spair(p) cout <<#p<<": "<<p.fi<<" "<<p.se<<endl
#define svec(v) cout<<#v<<":";rep(i,v.size())cout<<" "<<v[i];cout<<endl
#define sset(s) cout<<#s<<":";each(i,s)cout <<" "<<i;cout<<endl

using namespace std;

typedef pair<int,int>P;

const int MAX_N = 100005;

int main()
{
    while(1){
        int e;
        cin >> e;
        if(e == 0){
            break;
        }
        int z = 0;
        while(z*z*z <= e){
            z++;
        }
        int ans = INF;
        for(int i=0;i<z;i++){
            int rem = e - i*i*i;
            int y = 0;
            while(y*y <= rem){
                y++;
            }
            for(int j=0;j<y;j++){
                int x = rem - j*j;
                ans = min(ans,x+i+j);
            }
        }
        cout << ans << "\n";
    }

}

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

int main(){
  int e;
  while(1){
    cin >> e;
    if(e == 0) break;
    int z,y,x,min = 1000000000;

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

  return 0;
}

C++: #include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
#include <queue>

#pragma warning( disable: 4996 )

using namespace std;

typedef long long ll;

#define INF 100000000
#define EPS 1e-9

#define MAX_N 1000000

vector<int> ans_list;

int main(){

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

		int min_ans = MAX_N;

		for (int i = 0; i <= 100; i++){
			if (i*i*i > e)
				break;
			for (int j = 0; j <= 1000; j++){
				if (i*i*i + j*j > e)
					break;

				if (i*i*i + j*j <= e)
					min_ans = min(min_ans, i + j + e - i*i*i - j*j);
			}
		}

		ans_list.push_back(min_ans);

	}

	for (int i = 0; i < ans_list.size(); i++){
		cout << ans_list[i] << endl;
	}

	return 0;

}