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 <cmath>

using namespace std;

int main() {
	int hyou[102];
	for (int i = 0; i < 102; i++) {
		hyou[i] = i*i*i;
	}
	int e;
	while (cin >> e) {
		if (e == 0) {
			break;
		}
		int a, b, c;
		for (int i = 1; ; i++) {
			if (hyou[i] > e) {
				c = i-1;
				break;
			}
		}
		for (int i = 1; ;i++) {
			if (i*i > e-hyou[c]) {
				b = i-1;
				break;
			}
		}
		for (int i = 1; ;i++) {
			if (i > e-hyou[c]-b*b) {
				a = i-1;
				break;
			}
		}
		int MIN = a+b+c;
		for (int i = c-1; i >= 0; i--) {
			for (int j = b+1; ; j++) {
				if (j*j > e-hyou[i]) {
					b = j-1;
					break;
				}
			}
			int q = e-hyou[i]-b*b;
			MIN = min(MIN, b+q+i);
		}
		cout << MIN << endl;
	}
	return 0;
}

C++: #include <iostream>

using namespace std;

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

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

#define gcu getchar_unlocked
int in(int c){int n=0;bool m=false;if(c=='-')m=true,c=gcu();
	do{n=10*n+(c-'0'),c=gcu();}while(c>='0');return m?-n:n;}
int in() {return in(gcu());}
bool scan(int &n){int c=gcu();return c==EOF?false:(n=in(c),true);}
bool scan(char &c){c=gcu();gcu();return c!=EOF;}
//bool scan(string &s){int c;s="";
//	for(;;){c=gcu();if(c=='\n'||c==' ')return true;else if(c==EOF)return false;s+=c;}}
#define pcu putchar_unlocked
#define vo inline void out
template <typename T>
vo(T n){static char buf[20];char *p=buf;
	if(n<0)pcu('-'),n*=-1;if(!n)*p++='0';else while(n)*p++=n%10+'0',n/=10;
	while (p!=buf)pcu(*--p);}
vo(const char *s){while(*s)pcu(*s++);}
vo(char c){pcu(c);}
//vo(string &s){for (char c: s) pcu(c);}
template <typename head, typename... tail> vo(head&& h, tail&&... t){out(h);out(move(t)...);}
//template <typename T> vo(vector<T> &v){for(T &x:v)out(&x == &v[0]?"":" "),out(x);out('\n');}
#undef vo

int main() {
	for (int e, m; (e = m = in());) {
		for (int z = cbrt(e); z >= 0; z--) {
			int te = e - z * z * z;
			int y = (int)sqrt(te);
			int tm = z + y + te - y * y;
			m = min(m, tm);
			if (y > m)
				break;
		}
		out(m, '\n');
	}
}

C++: #include<algorithm>
#include<iostream>
#include<string>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
using namespace std;
int main(){
  int i,j;
  int a[102],b[1002],m,n;
  for(i=0;i<102;i++)
    a[i]=(int)pow(i,3);
  for(i=0;i<1002;i++)
    b[i]=(int)pow(i,2);
  while(cin>>n&&n){
    m=2000000000;
    for(i=0;a[i]<=n;i++)
      for(j=0;b[j]<=n-a[i];j++)
	m=min(m,n-a[i]-b[j]+i+j);
    cout<<m<<endl;
  }
  return 0;
}

C++: #include <iostream>
#include <algorithm>

using namespace std;

const int inf = 1000000;

int main()
{
  int s, t, u, e, m;

  while(cin>>e && e){
    bool f = true;
    m = inf+1;
    for(int z = 0; z <= 100; z++){
      s = z*z*z;
      for(int y = 0; y <= 1000; y++){
	t = y*y + s;
	if(e-t >= 0){
	  m = min(m, (z+y+(e-t)));
	}
      }
    }

    cout << m << endl;
  }

  return 0;
}

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

using namespace std;

void solve()
{
	int e;
	while(cin >> e, e)
	{
		int x = 0;
		int y = 0;
		int z = 0;
		while(pow((double)z, 3) < e)
		{
			++z;
		}
		int zbuf = 0;
		if(pow((double)z, 3) > e)
		{
			zbuf = z - 1;
		}
		else
		{
			zbuf = z;
		}
		int min = 100000000;
		int m = 0;
		for(int i = 0; i <= zbuf; ++i)
		{
			x = 0;
			y = 0;
			int ebuf = e;
			ebuf -= pow((double)i, 3);
			z = i;
			while(pow((double)y, 2) < ebuf)
			{
				++y;
			}
			if(pow((double)y, 2) > ebuf)
			{
				--y;
			}
			ebuf -= pow((double)y, 2);
			x = ebuf;
			if(min > x + y + z)
			{
				min = x + y + z;
			}
		}
		cout << min << endl;
	}
}

int main()
{
	solve();
	return(0);
}

C++: #include <iostream>
#include <math.h>
using namespace std;
int main(){
  int e = 1;
  while(1){
    int z = 0, y = 0, x = 0;
    int min_m = 1000000000;
    cin >> e;
    if(e == 0) break;
    // cout << "e: " << e << endl;
    while( e - pow(y,2) >= 0){
      z = 0;
      while(e - y*y - z*z*z >= 0){
        x = e - y*y - z*z*z;
        int m = x + y + z;
        // cout << "x" << x << "y" << y << "z" << z << endl;
        if (m < min_m){
          min_m = m;
        }
        z++;
      }
      y++;
    }
    cout << min_m << endl;
  }
}

C++: #include<iostream>
#include<cmath>
using namespace std;
int x,y,z;
int e;
int solve(){
	int minnum = 1000000;
	z=  (int)(pow (e,1/3));
	y = (int)sqrt(e - pow(z, 3));
	x = (int)(e - pow(z, 3)-pow(y, 2)); 
	return x+y+z;
};
int main(){
	int A[100000];
        int k = 0;
	while( cin>>e && e>0 )
	{
		A[k]=solve();
        k++;
	}
	for(int l = 0;l < k; l++)
        {
           cout<<A[l]<<endl;
        }
	return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i,j,k) for(int i=(int)j;i<(int)k;i++)
#define itrep(x) for(auto it=(x).begin();it!=(x).end();it++) 
#define Sort(x) sort((x).begin(),(x).end())
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define vi vector<int>
#define INF (int)1e9
#define INFL 1e18
#define MOD 1000000007
#define pb push_back
#define MP make_pair
typedef long long int ll;
typedef std::pair<int,int> P;
int D=1;
int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};
 
using namespace std;
 
int main(){
    while(1){
        int e;
        int ans=1e9+7;
        cin>>e;
        if(e==0)break;
         
        rep(y,0,1000){
            rep(z,0,1000){
                int x=e-y*y-z*z*z;
                if(x<0)continue;
                ans=min(ans,x+y+z);
            }
        }
        cout<<ans<<endl;
    }
    return 0;
}

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

int main(void){
  ios::sync_with_stdio(false);
  cin.tie(0);
  int e;
  while(cin >> e, e){
    int x, y, z;
    int ans = INT_MAX;
    for(z = 0; z <= pow(e, 1.0/3.0); z++){
      y = sqrt(e-pow(z, 3));
      x = e - pow(z, 3) - pow(y,2);
      ans = min(ans, x+y+z);
    }
    cout << ans << endl;
  }
  return 0;
}

C++: #include<bits/stdc++.h>
#define _ ios_base::sync_with_stdio(0);cin.tie(0);
#define REP(i,n) for(int i=0;i<(int)(n);i++)

using namespace std;

int main(){ _;
  int e;
  while(cin>>e,e!=0){
    int m=1<<29;
    REP(i,100){
      if(i*i*i>e) break;
      REP(j,1000){
	if(i*i*i+j*j>e)break;
	m=min(m,i+j+(e-i*i*i-j*j));
      }
    }
    cout<<m<<endl;
  }
}

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

int main(void){

  int e;

while(1){
    cin >> e;
    int ans = e;
    if(e == 0) break;
      for(int y=0; y <= sqrt(e); y++){
	for(int z=0;z <= pow(e,1.0/3.0); z++){
	int x = e - y*y - z * z * z;
	  if(e == x + y*y + z*z*z && x >= 0){
	    ans = min(ans,x+y+z);
	    //cout << x << ' ' << y << ' ' << z << endl;
	  }
	}
      }

    cout << ans << endl;

 }
  return 0;
}