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<vector>
#include<queue>
#include<cmath>
#include<algorithm>
#include<stack>
#include<map>
#include<set>
#define INF 2147483647
#define lli long long int

using namespace std;
typedef vector<int> vi;
typedef vector< vector<int> > vvi;

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

		cout << min << endl;
	}
	return 0;
}

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

int main(){
  while(1){
    int E;
    cin >> E;
    if(E==0) break;
    int x=0,y=0,z=0;
    int m = 1000000;
    for(z=0;z*z*z<=E;z++){
      for(y=0;(z*z*z)+(y*y)<=E;y++){
	x=E-(z*z*z)-(y*y);
	if(x+y+z<m){
	  m=x+y+z;
	  //cout << x << y << z << endl;
	}
      }
    }
    cout << m << endl;	
  }
  
}

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

}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int e;
  while(cin>>e&&e){
    int i,j,a,y,m=1000000000;
    for(i=1;i*i*i<=e;++i);
    a=i-1;
    for(i=0;i<=a;++i){
      int b=e;
      b=b-i*i*i;
      for(j=1;j*j<=b;++j);
      y=(j-1);
      b=b-y*y;
      m=min(m,b+y+i);
    }
    cout<<m<<endl;
  }
  return 0;
}

C++: #include <iostream>

using namespace std;

int E;
int x,y,z;
long long solve(){
    long long ans = 1000000;
    for (z=0;z*z*z<=E;z++)
        for(y=0;y*y<=E-z*z*z;y++){
            x = E-z*z*z-y*y;
            if (x+y+z<ans) ans=x+y+z;
        }
    return ans;
}
int main() {
    while(cin>>E&&E>0) cout<<solve()<<endl;
}

C++: #include <iostream>
#include <cmath>
using namespace std;
using ll = long long;
int main(void){
	while(1){
		ll num,ans=1000000;
		cin >> num;
		if(!num)	break;
		for(ll x=0;x<=100;x++){
			for(ll y=0;y<=100;y++){
				for(ll z=0;z<=100;z++){
					ll kazu=x+pow(y,2)+pow(z,3);
					if(kazu>num)	break;
					if(kazu==num){
						//cout << x << ' ' << y << ' ' << z << endl;
						ans = min(ans,(x+y+z));
					}
				}
			}
		}
		cout << ans << endl;
}
	return 0;
}

C++: #include<iostream>
#include<vector>
#include<algorithm>
#include<cctype>
#include<utility>
#include<string>
#include<cmath>
#include<cstring>
#include<queue>
#include<map>
#include<climits>
 
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
using namespace std;
typedef pair<int, int> P;
typedef long long int ll;
typedef pair<ll,ll> LLP;
#define INF 1000000007
 
#define ARRAY_MAX 100005
 
int main(){

    int n;
    while(cin >> n,n){
        vector<int> vec;
        int mini = INF;
        for(int i = 0;i*i*i <= n;i++){
            for(int j = 0;j*j <= n;j++){
                if(n - i*i*i - j*j >= 0){
                    mini = min(mini,i+j+n-i*i*i-j*j);
                }
            }
        }
        cout << mini << endl;
    }



    return 0;
}

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

#define REP(i,n) for(int i=0;i<n;++i)
#define RREP(i,n) for(int i=n-1;i>=0;--i)
#define FOR(i,m,n) for(int i=m;i<n;++i)
#define RFOR(i,m,n) for(int i=n-1;i>=m;--i)
#define ALL(v) v.begin(),v.end()
#define PB(a) push_back(a)
#define INF 1000000001
#define MOD 1000000007

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

using namespace std;


int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	while (1) {
		int e, ans=INF;
		cin >> e;
		if (!e) break;
		for (int i = 0;i*i*i <= e;++i) {
			int y = sqrt(e - i*i*i);
			int x = e - i*i*i - y*y;
			ans = min(ans, x + y + i);
		}
		cout << ans << endl;
	}
	return 0;
}

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

int Count = 0; //    global

int solve(int E) {
  int x,ans=1000110;
  Count=0;
  for (int z=0; z*z*z<=E; ++z)
    for (int y=0; y*y<=(E-z*z*z); ++y)
      {
	Count++;
	x=(int)E-y*y-z*z*z;
	if(x+y*y+z*z*z==E)
	  {
	    if(ans>x+y+z)
	      ans=x+y+z;
	  }
      }
  return ans;
}

int main() {
  int E;
  while (cin >> E && E>0) {
    cout << solve(E) << endl;
    //cout<<"count="<<Count<<endl;
  }
}

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

int Bsearch(int e,int n){
  //cout << n << endl;
  int l=0,r=e;
  int i=(l+r)/2;
  while(r-l>=1){
    i=(l+r)/2;
    //cout << "i:" << i << endl;
    if(e == pow(i,n)){
      //cout << "aaa:" << i << endl;
      return i;
    }else if(e > pow(i,n)){
      l=i+1;
    }else{
      r=i;
    }
  }
  //cout << "i:" << i << endl;
  return i;
}

int a[2000][2000];

int main(){
  int x,y,z,e;
  while(cin>>e,e){
    memset(a,0,sizeof(a));
    y=Bsearch(e,2);
    z=Bsearch(e,3);

    int m=1000000;
    //cout << "z:" << z << " y:" << y << endl;
    for(int i=0;i<=y;i++){
      for(int j=0;j<=z;j++){
	x=e-i*i-j*j*j;
	if(x>=0)m = min(x+i+j,m);
      }
    }
    cout << "ans:" <<m << endl; 
  }
}

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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef complex<double> Point;

#define PI acos(-1.0)
#define EPS 1e-10
const ll INF = 1e16;
const ll MOD = 1e9 + 7;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define rep(i,N) for(int i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define EQ(a,b) (abs((a)-(b))<EPS)
#define EQV(a,b) ( EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()) )
#define fi first
#define se second
#define N_SIZE (1LL << 20)
#define NIL -1

ll mod_add(ll a, ll b) { return (a + b) % MOD; }
ll mod_sub(ll a, ll b) { return (a - b + MOD) % MOD; }
ll mod_mul(ll a, ll b) { return a*b % MOD; }

ll e;

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

C++: #include<stdio.h>
#include<math.h>
int main(){


int E;
while(1){
scanf("%d",&E);if(E==0)break;
int min=E;int m=E,max=0;
int i=1;int y=0,z=0;
for(int j=0;j<=sqrt((double)(E));j++){
for(int k=0;k<=sqrt((double)E);k++)
{i=E-j*j-k*k*k;//printf("%d %d %d\n",i,j,k*k*k);
	//if(i+j*j+k*k*k>E)break;
	if(i>=0&&i+j*j+k*k*k==E&&i+j+k<min){min=i+j+k;max=j*j+k*k*k;y=j;z=k;}
}}
i=E-y*y-z*z*z;
m=i+y+z;
printf("%d\n",min);
}
return 0;
}