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>
#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 dou(int a){
  return a*a;
}

int tri(int a){
  return a*a*a;
}
 
int main(){

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

	int x,y,z;

	int cb = cbrt(e);
	
	int m = 1000000;

	REP(i,cb){
	  z = cb - i;
	  int huga = sqrt(e - tri(z));
	  REP(j,huga){
		y = huga - j;
		x = e - tri(z) - dou(y);
		if(m>(x+y+z)) m = x+y+z;
	  }
	}

	cout << m << endl;

	//	cout << z << endl;


  }
}

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

using namespace std;

int INF = 10000000;

int cast(int e)
{
	
	

	 int Min = INF;

	 for(int i = 0;i*i*i <= e;i++)
	 {
		 for(int j = 0;j*j <= e-i*i*i;j++)
		 {
			 int k = e - i*i*i - j*j;
			 if(k >= 0)
			 {
				Min = min(i+j+k,Min);
			 }else
			 {
				 break;
			 }
		 }
	 }


	return Min;
}


int main()
{

  while(1)
  {
	 int e;

	 cin >> e;
 
	 if(!e)break;
	
	 cout << cast(e) << endl;

  }

  return 0;
}

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

int main(){
  int e;
  while(cin >> e,e){
    int x,y,z;
    int min = 10000;
    for(int i=0; i<=e; ++i){
      for(int j=0; j<=e; ++j){
	int tmp_j = j*j;
	if(tmp_j >= e)break;
	for(int k=0; k<=e; ++k){
	  int tmp_k = k*k*k;
	  if(tmp_k >= e)break;
	  if(e == i+tmp_j+tmp_k && min > i+k+j){
	    min = i+j+k;
	  }
	}
      }
    }

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

C++: #include<stdio.h>
int main(void){
	int x,y,z,e,i,j;
	while(1){
		scanf("%d",&e);
		if(e==0)break;
		x=0;y=0;z=0;
		for(;z*z*z<e;)z++;
		if(z*z*z==e)i=z;
		else {
			z--;
			for(;y*y+z*z*z<e;)y++;
		}
		if(y*y+z*z*z==e)i=y+z;
		else {
			y--;
			for(;;){
				x++;
				if(x+y*y+z*z*z==e){
					i=x+y+z;
					break;
				}
			}
		}

		x=0;y=0;z=0;
		for(;y*y<e;)y++;
		if(y*y==e)j=y;
		else {
			y--;
			for(;y*y+z*z*z<e;)z++;
		}
		if(y*y+z*z*z==e)j=y+z;
		else {
			z--;
			for(;;){
				x++;
				if(x+y*y+z*z*z==e){
					j=x+y+z;
					break;
				}
			}
		}

		if(i<=j)printf("%d\n",i);
		else printf("%d\n",j);
	}
	return 0;
}

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

int main(){

  while(cin >> E && E > 0 )

    int min = 10000001; 
    for (int z = 0; 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;
}

C++: #include <bits/stdc++.h>
using namespace std;
const int dx[]={1,0,0,-1,1,-1,-1,1,2,0,-2,0};
const int dy[]={0,1,-1,0,1,1,-1,-1,0,2,0,-2};
const int INF = 1<<30;
const double EPS = 1e-8;
#define PB push_back
#define mk make_pair
#define fr first
#define sc second
#define reps(i,j,k) for(int i = (j); i < (k); ++i)
#define rep(i,j) reps(i,0,j)
#define MOD 1000000007
#define lengthof(x) (sizeof(x) / sizeof(*(x)))
typedef pair<int,int> Pii;
typedef pair<int,Pii > P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef long long ll;
int main(){
	int e;
	while(scanf("%d",&e),e){
		int ans = INF;
		rep(x,1000000){
			rep(y,1000){
				rep(z,100){
					if(x+y*y+z*z*z == e){
						printf("%d\n",x+y+z);
						goto next;
					}
				}
			}
		}
		next:;
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
void solve(int n){
    int ans=INT_MAX;
    int j,tmp;
    for(int i=0;i*i*i<=n;i++){
        tmp=n-i*i*i;
        for(j=0;j*j<=tmp;j++){}
        j--;
        ans=min(ans,i+j+tmp-j*j);
    }
    cout<<ans<<endl;
}

int main(void){
    int n;
    while(cin>>n,n){
        solve(n);
    }
    
}

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


int main(){
	int e;
	while(cin >> e , e){
		int m=1<<29;
		for(int z=0 ,z1=0;z<=e; ++z1 , z=pow(z1,3.)){
			for(int y=0 , y1=0;y<=e; ++y1 , y=pow(y1,2.)){
				int x=e-(y+z);
				if(x>=0) m= min(m , x+(int)sqrt(y)+(int)cbrt(z));
			}
		}
		cout << m << endl;
	}
	return 0;
}

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

int main() {
    int e;
    while (cin >> e && e != 0) {
        int vmin = -1;
        for (int yi = 0; yi <= sqrt(e); ++yi) {
            for (int zi = 0; zi <= pow(e, 1.0/3.0); ++zi) {
                int xi = e - yi*yi - zi*zi*zi;
                if (xi < 0) continue;
                if (xi + yi*yi + zi*zi*zi == e) {
                    if (vmin == -1) vmin = xi+yi+zi;
                    else vmin = min(vmin, xi+yi+zi);
                }
            }
        }
        cout << vmin << endl;
    }
}

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 dou(int a){
  return a*a;
}

int tri(int a){
  return a*a*a;
}
 
int main(){

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

	int x,y,z;

	int cb = cbrt(e+0.00001);
	
	int m = 1000000;

	REP(i,cb){
	  z = cb - i;
	  int huga = sqrt(e - tri(z)+0.000001);
	  REP(j,huga){
		y = huga - j;
		x = e - tri(z) - dou(y);
		if(m>(x+y+z)) m = x+y+z;
	  }
	}

	cout << m << endl;

	//	cout << z << endl;


  }
}

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

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