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 <bits/stdc++.h>
#include <tuple>
#include <iterator>
using namespace std;
using ll = long long;
const int INF = 1e6;

int main()
{
  int e;
  vector<int> ans;
  while (cin >> e, e)
  {
    int nx, ny, nz;
    int m = INF;
    for (int z = 0; z <= 100; ++z)
    {
      for (int y = 0; y <= 1000; ++y)
      {
        int x = e - y * y - z * z * z;
        if (x >= 0)
          m = min(m, x + y + z);
      }
    }
    ans.push_back(m);
  }
  for (auto &v : ans)
    cout << v << endl;

  return 0;
}

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

#define E 1000000

int main()
{
	int e;

	while (cin >> e && e > 0) {
		int min = E + 1;
		int e_i, e_j;
		e_i = 1000;
		e_j = 100;
		for (int i = 0; i < e_i; i++) {
			for (int j = 0; j < e_j; j++) {
				if (i*i + j*j*j > e)
					break;
				int s;
				s = (e - i*i - j*j*j) + i + j;
				
				if (s < min)
					min = s;
			}
		}

		cout << min << endl;

	}



    return 0;
}

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

using namespace std;

int32_t main() {
  while (true) {
    uint32_t e;
    cin >> e;

    if (e == 0)
      break;

    uint32_t m = UINT32_MAX;
    for (uint32_t a = 0; a * a * a <= e; a++) {
      for (uint32_t b = 0; b * b <= e - a * a * a; b++) {
        uint32_t c = e - a * a * a - b * b;
        m = min(m, a + b + c);
      }
    }

    cout << m << endl;
  }

  return 0;
}

C++: #include <iostream>
#include <cmath>
 
using namespace std;
 
int pw (int n, int p) {
  if (n == 0) return 0;
  if (p == 0) return 1;
  if (p == 1) return n;
  return n * pw(n, p-1);
}
 
int computeM (int e) {
   
  int ret = e;
   
  // zukky&#227;&#129;&#8226;&#227;&#8218;“&#227;&#129;&#174;&#227;&#8218;&#179;&#227;&#402;&#161;&#227;&#402;&#179;&#227;&#402;&#710;&#227;&#129;&#171;&#227;&#8218;&#710;&#227;&#8218;&#8249;&#227;&#402;’&#227;&#402;&#179;&#227;&#402;&#710;&#227;&#8218;’&#232;?&#8249;&#227;&#129;&#376;&#227;&#8364;&#8218;
  // z&#227;&#129;&#338;&#230;&#339;&#8364;&#227;&#8218;&#8218;&#232;‡&#170;&#231;”±&#229;&#186;?&#227;&#129;&#174;&#229;°&#143;&#227;&#129;&#8226;&#227;&#129;&#8222;&#230;&#8226;°&#227;&#129;&#170;&#227;&#129;&#174;&#227;&#129;§&#227;&#8364;&#129;z&#227;&#129;&#8249;&#227;&#8218;‰&#230;±&#186;&#229;&#174;&#353;&#227;&#129;—&#227;&#129;?&#227;&#129;&#8222;&#227;&#129;&#143;&#227;&#8364;&#8218;
 
  for(int y = 0; y <= sqrt(e); y++) {
    for(int z = 0; z <= sqrt(e); z++) {
      int temp = pw(y, 2) + pw(z, 3);
      int x = e - temp;
      if (x < 0) x = 0;
      if (x + temp == e) ret = min(x + y + z, ret);
    }
  }
   
 
  return ret;
}
 
int main (void) {
  int e, m;
 
  while (1) {
    cin >> e; if (e == 0) break;
    m = computeM(e);
    cout << m << endl;
  }
  return 0;
}

C++: #include<iostream>

using namespace std;

int main(){
	int e,sub,data;
	int x,y,z;
	cin >> e;
	while(e!=0){
		for(z=1;;z++){
			if(z*z*z>e){
				z--;
				break;
			}
		}

		data=100000;

		for(;z>=0;z--){
			sub=z*z*z;
			for(y=1;;y++){
				if((sub+y*y)>e){
					y--;
					break;
				}
			}
			sub=sub+y*y;
			for(x=1;;x++){
				if((sub+x)>e){
					x--;
					break;
				}
			}	
			if(data>(x+y+z)){
				data=x+y+z;
			}

		}
		cout << data << '\n';
		cin >> e;
	}
}

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

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


		cout << ans << endl;
	}
}

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)+100; 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 <iostream>
#include <math.h>
using namespace std;


int main() {
    int E,x,y,z,m;
    while (cin >> E && E>0) {
       m = 1000000;
       for (int i = 0 ; i <= 100 ; i++) {
           for (int j = 0 ; j <= 1000 ; j++){
               x = E - i*i*i - j*j;
               if (x+j+i<=m && x>=0) m = x+j+i;
           }
       }
       cout << m <<endl;
    }
}

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);
				else
					break;
			}
		}
		printf("%d\n", res);
	}
}

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

int e;
const int max_e = 2000000;

signed main() {
	while (cin >> e && e > 0) {
		int ans = max_e;
		for (int z = 0; pow(z, 3) <= e; ++z) {
			for (int y = 0; y*y <= e - z*z*z; ++y) {
				int x = e - z*z*z - y*y;
				int eTemp = x + y + z;
				ans = min(ans, eTemp);
			}
		}
	cout << ans << endl;
	}
}