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 <bits/stdc++.h>
using namespace std;
int main()
{
    int e;
    cin >>e;

    while(e)
    {
        int x=0;
        int y=0;
        int z=0;
        int m=0;
        for(int x = 0;x<=e;x++)
            for(int y=0;y<=e;y++)
                for(int z = 0;z<=e;z++)
        {
            if(e==x+y*y+z*z*z)
            {
                int t = x+y+z;
                if(m ==0)
                    m=t;
                else if(m >t)
                    m=t;

            }
        }
        cout <<m<<endl;




        cin >>e;
    }
    return 0;
}

C++: n,i,j;
#define rep(i,a) for(i=0;i<a;i++) 
main(){
	while(scanf("%d",&n),n){
		int mi=999;
		rep(i,110)rep(j,1010)mi=fmin(mi,(n<i*i*i+j*j?999:i+j+n-i*i*i-j*j));
		printf("%d\n",mi);
	}
0;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <stack>
#include <cstdio>
#define rep(i, j) for(int i = 0; i < j; i++)
#define all(i) i.begin(), i.end()
using namespace std;
int main()
{
	int e; while (cin >> e , e)
	{
		int m = 214214, x = 0;
		rep(z, 101) rep(y, 1001)
		{
			x = e - (y * y + z * z * z);
			if (e == x + (y * y) + (z * z * z) && x >= 0 ) 
			{ m = min(x + y + z, m); }
		}
		printf("%d\n", m);
	}
	return 0;
}

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

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

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



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

	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <time.h>
#include <math.h>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <iterator>
#include <sstream>
#include <string>
#include <bitset>
using namespace std;
#define FOR(I,F,N) for(int I = F; I < (int)(N); I++)
#define rep(i, n) FOR(i, 0, n)
#define FIN(V) cout<<V<<endl
#define pb push_back
#define INF (1 << 28)

template<typename T>
void remove(vector<T>& vector, unsigned int index){
vector.erase(vector.begin() + index);
}

typedef pair<int, int> P;
typedef long long ll;
typedef priority_queue<int> pq;
int StrToInt(string);
string IntToStr(int);
int dx[4] = {1, -1, 0, 0};
int dy[4] = {0, 0, 1, -1};

int main(void){
	int e;
	while(cin >> e, e){
		int mini = e;
		for(int z = 0; e >= pow(z,3); z++){
			for(int y = 0; e >= pow(y,2); y++){
				int x = e - pow(z,3) - pow(y,2);
				if(x < 0)continue;
				mini = min(mini, x+y+z);
			}
		}
		cout << mini << endl;
	}

	return 0;
}



int StrToInt(string s){
	stringstream ss;
	ss << s;
	int val;
	ss >> val;
	return val;
}
string IntToStr(int i){
	stringstream ss;
	ss << i;
	return ss.str();
}

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

using namespace std;

#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define vec vector

int main(void)
{
    while(1) {
	int e;
	cin >> e;
	if (!e) break;

	int m = e;
	for (int z = 0; z*z*z <= e; z++) {
	    for (int y = 0; y*y + z*z*z <= e; y++) {
		int x = e - z*z*z - y*y;
		int temp = x + y + z;
		if (m > temp) m = temp;
	    }
	}
	cout << m << endl;
    }
    return 0;
}

C++: #include <iostream>
#include <cmath>
using namespace std;
int E;
int main(){
  while(cin >> E && E>0){
    int m = 500;
    for (int z=0; z<=cbrt(E); z++){
      if(z >= m) break;
        for(int y=0; y<= sqrt(E-z*z*z);y++){
	 if (y+z >= m) break;
	    int x = E - z*z*z - y*y;
	    if (x >= 0){
	      if(x+y+z < m){
		m = x+y+z;
	      }
	    }
      }
    }
    cout << m << endl;
  }
}

C++: #include <iostream>

using namespace std;

int main(){
  int e,ee,m,x,y,z;
  while (true){
    cin >> e;
    if (!e)
      break;
    x = 0;
    y = 0;
    z = 0;
    m = e;
    while(e>=z*z*z){
      ee = e;
      ee -= z*z*z;
      y = 0;
      while(ee>=y*y)
	y++;
      y--;
      ee -= y*y;
      x = ee;
      if (m>x+y+z)
	m = x+y+z;
      z++;
    }
    z--;
    cout << m << endl;
  }
  return 0;
}

C++: #include<iostream>
#include<math.h>
using namespace std;
int solve(int E){
    int ans=E;
    for (int z=0;z*z*z<=E;++z){
        for (int y=0;y*y<=E;++y){
            for(int x=0;x<E;++x)
                if(x+y*y+z*z*z==E&&x+y+z<ans)
                    ans=x+y+z;
            
        }
    }
    return ans;
}
int main(){
    int E;
    while (cin>>E&&E>0){
        cout<<solve(E)<<endl;
    }
}

C++: #include <iostream>

using namespace std;

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

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

bool isint(double x){
	int a=(int)x;
	if(a==x) return true;
	return false;
}

int main(){
	int e;
	while(cin >> e , e){
		int m=1e+9;
		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<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<utility>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<math.h>
using namespace std;
#define mod (1000000000+7)
#define N (10007)
#define INF 1e16
typedef long long ll;
typedef pair<ll,ll> P;


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

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

long long e, x, y, z, m;

int main (){
	x = 0;
	while (cin >> e && e > 0){
		m = 1000;
		for (z = 0; z * z * z <= e; z++){
			for (y = 0; y * y + z * z * z <= e; y++){
			       	x = e - y * y - z * z * z;
				m = min (m, x + y + z);
			}
		}
		cout << m << 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;
  }
}