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 <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <ctime>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <numeric>
#include <list>

using namespace std;

#ifdef _MSC_VER
#define __typeof__ decltype
template <class T> int __builtin_popcount(T n) { return n ? 1 + __builtin_popcount(n & (n - 1)) : 0; }
#endif

#define foreach(it, c) for (__typeof__((c).begin()) it=(c).begin(); it != (c).end(); ++it)
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define popcount __builtin_popcount

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

template <class T> void max_swap(T& a, const T& b) { a = max(a, b); }
template <class T> void min_swap(T& a, const T& b) { a = min(a, b); }

const double EPS = 1e-10;
typedef long long ll;
typedef pair<int, int> pint;


int main()
{
	int e;
	while (scanf("%d", &e), e)
	{
		int res = e;

		int z_max = pow(e, 1.0 / 3) + 1;
		int y_max = (int)sqrt(e + 0.0) + 1;
		for (int z = z_max; z >= 0; --z)
		{
			for (int y = y_max; y >= 0; --y)
			{
				int x = e - (z*z*z + y*y);
				if (x >= 0)
					min_swap(res, x + y + z);
			}
		}
		printf("%d\n", res);
	}
}

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

int main(){
  int E;
  while(cin >> E){
    int sum;
    for(int z=100;z>=0;z--){
      if(E-z*z*z>0){
        int t=E-z*z*z;
        int y=(int)sqrt(t);
        int x=t-y*y;
        sum=x+y+z;
        break;
      }
    }
    cout << sum<<endl;
  }
}

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

int main(){

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

    int min = 1000001; 
    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<algorithm>
#include<cstdio>
#include<cmath>
#define repi(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,a) repi(i,0,a)

int e;

int main()
{
  while( scanf( "%d", &e ), e )
  {
    int ans = 1000001;
    
    rep( x, e+1 ) rep( y, sqrt(e)+1 ) rep( z, cbrt(e)+1 ) if( x+y*y+z*z*z == e )
      ans = std::min( ans, x+y+z );

    printf( "%d\n", ans );
  }

  return 0;
}

C++: #include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <bitset>
#include <cstring>
using namespace std;
#define FOR(I,A,B) for(int I = (A); I < (B); ++I)
#define CLR(mat) memset(mat, 0, sizeof(mat))
typedef long long ll;

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

C++: #include <cstdio>

int main(void)
{
    int e;
    int x, y, z, xyz;
    while(scanf("%d", &e), e != 0){
        for(xyz = 1; xyz <= e; xyz++){
            for(z = 0; z <= xyz && z * z * z <= e; z++){
                for(y = 0; z + y <= xyz && z * z * z + y * y <= e; y++){
                    x = xyz - z - y;
                    if(x + y * y + z * z * z == e){
                        printf("%d\n", xyz);
                        z = xyz = e;
                        break;
                    }
                }
            }
        }
    }
    return 0;
}

C++: #include<iostream>
#include<iomanip>
#include<algorithm>
#include<bitset>
#include<cctype>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<functional>
#include<limits>
#include<list>
#include<map>
#include<set>
#include<stack>
#include<string>
#include<sstream>
#include<queue>
#include<vector>
using namespace std;

#define MOD 1000000007
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL

#define MAX 1000000

int main() {

	for (int e; cin >> e&&e;) {
		int m = INF;
		int max_z = pow(e, 1. / 3)+1;
		for (int z = max_z; z >= 0; z--) {
			if (z*z*z > e)continue;
			//cout << "z " << z;
			int tmp = e;
			tmp -= z*z*z;
			int y = pow(tmp, 1. / 2);
			//cout << " y " << y;
			tmp -= y*y;
			int x = tmp;
			//cout << " x " << x;
			m = min(m, x + y + z);
			//cout << " m " << x + y + z;
			//cout << endl;
		}
		cout << m << endl;
	}
	return 0;
}

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

using namespace std;

void solve()
{
	int e;
	while(cin >> e, e)
	{
		vector<int> data;
		for(int i = 0; i * i * i <= e; ++i)
		{
			for(int j = 0; j * j <= e; ++j)
			{
				if(i * i * i + j * j > e)
				{
					break;
				}
				for(int k = 0; k <= e; ++k)
				{
					if(i * i * i + j * j + k > e)
					{
						break;
					}
					else if(i * i * i + j * j + k == e)
					{
						data.push_back(i + j + k);
					}
				}
			}
		}
		sort(data.begin(), data.end());
		cout << data[0] << endl;
	}
}

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

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

int main(){
int e;
while(cin >> e){
int ans = 1000000000;
for(int z=1;z*z*z<e;z++)
for(int y=1;y*y+z*z*z<e;y++)
ans = min(ans,(e-y*y*-z*z*z) + y  + z);
cout << ans << endl;
}

C++: #include <iostream>
#include <cmath>
using namespace std;
int main(){
  int e,m;

  while(cin >> e && e>0){
      m=e;
    for(int x=0; x<=e; x++){
      for(int y=0; x+pow(y,2)<=e; y++){
        for(int z=0; x+pow(y,2)+pow(z,3)<=e; z++){
          if(x+y*y+z*z*z==e && x+y+z<m)
            m=x+y+z;
        }
      }
    }

    cout << m << endl;
  }
}