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>

using namespace std;

int max(int ,int );

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

C++: #include <iostream>

using namespace std;

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

C++: #include <iostream>
#include <math.h>
#include <algorithm>
using namespace std;
int main(void){
    int e;
    while(1){
        cin>>e;
        if(e==0)break;
        int ans=1000000000;
        for(int i=pow(e,0.334);i>=0;i--){
            for(int j=pow(e,0.5);j>=0;j--){
                if(e-i*i*i-j*j>=0){
                    ans=min(ans,i+j+(e-i*i*i-j*j));
                }
            }
        }
        cout<<ans<<endl;
    }
    return 0;
}

C++: #include <cstdio>

inline 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;
                }else if(x + y * y + z * z * z > e)
                    break;
            }
        }
    }
}

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

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

int main(){
    while(true){
        int e;
        int f;
        int ans=1000000;
        cin >> e;
        if(!e) break;
        for(int i=0;i<100;++i){
            f = e - i*i*i;
            if(f < 0) break;
            for(int j=0;j<1000;++j){
                if(j*j > f){
                    ans = min(ans, f-(j-1)*(j-1)+j-1+i);
                    break;
                }
            }
        }
        cout << ans << endl;
    }
}

C++: #include<iostream>

int main(){
	int e;
	while(1){
		std::cin >> e;
		if(!e)break;
		int m = 1000001;
		for(int i=0;i*i*i<=e;i++){
			for(int ii=0;i*i*i + ii*ii<=e;ii++){
				for(int i3=0;i*i*i + ii*ii + i3 <= e;i3++){
					if(i*i*i + ii*ii + i3==e){
						int tmp = i+ii+i3;
						if(tmp < m) m = tmp;
					}
				}
			}
		}
		std::cout << m << std::endl;
	}
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <map>
#include <string>
#include <stack>
#include <queue>
#include <algorithm>
using namespace std;

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

C++: #include<iostream>
#include<cmath>
using namespace std;
int Bsearch(int n,int e){
  if(e==1)return 1;
  int s,t;
  s=0;t=e;
  int x=e/2;
  while(t-s>1){
    if(pow(x,n)<e){
      s=x;
    }else if(pow(x,n)>e){
      t=x;
    }else{
      break;
    }
    x=(s+t)/2;
  }
  return x;
}

int main(){
  int e;
  while(cin>>e){
    if(e==0)break;
    int x=Bsearch(3,e);
    int y=Bsearch(2,e);
    int minim=1000;
    for(int i=0;i<=x;i++){
      for(int j=0;j<=y;j++){
	int x=e-pow(i,3)-pow(j,2);
	if(x<0)break;
	minim=min(minim,i+j+x);
      }
    }
    cout << minim << endl;
  }
  return 0;
}

C++: #include <iostream>
#include <math.h>
using namespace std;
int main(){
//	FILE* fp_in = freopen("2012_input.txt", "r", stdin);
//	FILE* fp_out = freopen("result.txt", "w", stdout);

	int x,sum;
	int e;
	while(1) {
		int max = 1000000;
		cin >>e ;
		if(e == 0) break;
		for(int i=0;i*i*i<=e;i++){
			for(int j=0;j*j<=e-i*i*i;j++){
				x = e-i*i*i-j*j;
				sum = x+i+j;
				if (sum<max) max =sum;
			}
		}
		cout << max <<endl;
	}
//	fclose(fp_in);
//	fclose(fp_out);

		return 0;
}

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

int main(){
  long x,y,z,min=1000000,e;
  while(true){
    min=1000000;
    cin>>e;
    if(e==0)break;
    //x,y,zが最小になる値を算出する
    for(y=0; y<1000; y++){
      for(z=0; z<100; z++){
	x = e-pow(y,2)-pow(z,3);
	if(x<0)continue;
	if(e == (x+pow(y,2)+pow(z,3)) && min > x+y+z){
	  min = x+y+z;
	  //printf("x:%ld y:%ld z:%ld Min is now %ld\n",x,y,z,min);
	}
	
      }
    }
    cout<<min<<endl;
  }
  return 0;
}

C++: #include <iostream>
#include <cmath>
using namespace std;
int E;
int main(){
  while(cin >> E && E>0){
    int m = 1000000;
    for (int z=0; z<=100; z++){
      for(int y=0; y<= E- pow(z,3);y++){
	int x = E - pow(z,3) - pow(y,2);
	if (x>=0){
	  int n = x+y+z;
	  if(n < m && m > 0){
	    m = n;
	  }
	}
      }
    }
    cout << m << endl;
  }
}

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

int e, m;

int main(void){
  while(cin >> e && e != 0){
    m = 1000000;
    for(int y = 0; y <= 1000; y++){
      for(int z = 0; z <= 100; z++){
        int x = e - y * y - z * z * z;
        if(x < 0) continue;
        if(x + y + z < m) m = x + y + z;
      }
    }
    cout << m << endl;
  }
  return 0;
}

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

int getMinM(int e){
	int mini=INT_MAX;
	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(e== x + y*y + z*z*z && x>=0) mini=min(mini,x+y+z);
		}
	}
	return mini;
}

int main(){
	while(1){
		int e;
		cin >> e;
		if(e==0) break;
		int mini=INT_MAX;
		cout << getMinM(e) << endl;
	}
	return 0;
}

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

int main ()
{
    int e, dp[1000001];
    for (int i = 0; i < 1000001; i++) {
        dp[i] = i;
    }

    for (int i = 0; i < 101; i++) {
        dp[i * i * i] = min(i, dp[i * i * i]);
        for (int j = 0; i * i * i + j * j < 1000001 && j < 1001; j++) {
            dp[j * j] = min(j, dp[j * j]);
            dp[i * i * i + j * j] = min(i + j, dp[i * i * i + j * j]);
        }
    }

    for (int i = 1; i < 1000001; i++) {
        dp[i] = min(dp[i-1] + 1, dp[i]);
    }

    while (cin >> e, e) {
        cout << dp[e] << endl;
    }

    return 0;
}

C++: #include <iostream>
#include <math.h>
using namespace std;
int N, S, y_max, z_max, ans;

int main(){
  while( cin >> N && N > 0){
    for(int i = 0; i <= 1000; i++){
      for(int j = 0; j <= 100; j++){
        if(i == 0 && j == 0) ans = N;
        if(ans > (i + j +(N-i*i-j*j*j)) && N-i*i-j*j*j >= 0) ans = i + j +(N-i*i-j*j*j);
      }
    }


    cout << ans << endl;


  }




}

C++: int main()
{
  while(1){
    int e;
    cin >> e;
    if(e == 0) break;
    int ans = e + 1;
    for(int x = 0; x*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)
            ans = min(ans,x+y+z);
    cout << ans << endl;
  }
}

C++: #include<iostream>
#include<algorithm>
#define MAX 10000000L;
using namespace std;

int main()
{
	long e;
	while (cin >> e && e != 0)
	{
		long min_m = MAX;
		for (long z = 0; z * z * z <= e; z++)
		{
			for (long y = 0; y * y<= e - z * z * z; y++)
			{
				for (long x = 0; x <= e - y * y - (z * z * z); x++)
				{
					if (e == x + y * y + z * z * z)
					{
						min_m = min(min_m, x + y + z);
					}
				}
			}
		}
		

		cout << min_m << endl;
	}


	return 0;
}