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 E;
int main(){
  while(cin >> E && E>0){
    int m = 1000000;
    for (int z=0; z*z*z<=E; z++){
      //if(z >= m) break;
        for(int y=0; y*y<= 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<bits/stdc++.h>
using namespace std;

int main(){
  int e;
  while(cin >> e, e){
    int num;
    int ans = 1e9;
    for(int i = 0; i < e; i++){
      if(i * i * i > e)break;
      for(int j = 0; j < e; j++){
        num = e - i * i * i - j * j;
        if(num < 0)break;
        ans = min(ans, num + i + j);
      }
    }
    cout << ans << endl;


  }
}

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

void solve() {
  int minm = 1000000;
  for (int z = 0; z < 100; z += 1) {
    for (int y = 0; y < 1000; y += 1) {
      int x = e - z*z*z - y*y;
      if (x < 0) continue;
      int m = x + y + z;
      minm = min(minm, m);
    }
  }
  cout<<minm<<endl;
}

int main (int argc, char const* argv[]) {
  while (cin>>e, e) {
    solve();
  }
  return 0;
}

C++: //author: toruneko
// 2020/04/27 18:39
//vertict: 

#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define repr(i, n) for (int i = (n); i >= 0; --i)
#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define FORR(i, m, n) for (int i = (m); i >= (n); --i)
#define equals(a, b) (fabs((a) - (b)) < EPS)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
const ll mod = 1000000007;
//const ll mod = 998244353;
const int inf = 1e9 + 10;
const ll INF = 1e18;
const ld EPS = 1e-10;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }

ll e;

void solve() {
  ll ans = INF;
  rep(z, e + 1) {
    ll res = z * z * z;
    if (res > e) break;
    rep(y, e + 1) {
      ll res2 = res + y * y;
      if (res2 > e) break;
      ll x = e - res2;
      chmin(ans, x + y + z);
    }
  }
  cout << ans << '\n';
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(25);

  while (cin >> e) {
    if (e == 0) break;

    solve();
  }




  
  return 0;
}

C++: #include <cstdio>
const int inf = 1e9;

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

        for (int z = 0; z * z * z <= e; ++z) {
            for (int y = 0; y * y <= e - z * z * z; ++y) {
                chmin(mi, e - z * z * z - y * y + y + z);
            }
        }

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

C++: #include<iostream>
#include<math.h>
#include <limits.h>
using namespace std;
int count = 0;
int solve(int E)
{
  int ans =1000;
  for (int x=0; x<=E; ++x)
    for (int y=0; y*y<=E; ++y)
      {
	//cout<<"y="<<y<<endl;
	int z=(int)round(pow(E-x-y*y,1.0/3));
	//cout<<"z="<<z<<endl;
	if (x+y*y+z*z*z == E)
	{
	  if((x+y+z)<ans)
	  {
	    ans=x+y+z;
	    // cout<<ans<<endl;
	  }
	}
      }
  return ans;
}
int main()
{
  int E;
  while (cin >> E && E>0)
  {
    cout << solve(E) << endl;
  }
}

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



int main(){
	int e;
	int minimum = 10000000;
	cin >> e;
	while(e != 0){
		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<algorithm>
using namespace std;

int main() {
	int e, ans;

	while (1) {
		cin >> e;

		if (e == 0) break;
		ans = e;

		for (int i = 0; i * i * i <= e; i++) {
			for (int j = 0; j * j + i * i * i <= e; j++) {
				if (ans > i + j + (e - i * i * i - j * j)) ans = i + j + (e - i * i * i - j * j);
			}
		}
		cout << ans << endl;
	}
	return 0;
}

C++: 
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <stack>
#include <cctype>
#include <complex>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <cassert>

using namespace std;


bool solve(){
	int n;
	cin>> n;
	if(!n) return false;
	int ans = 1000000;
	for(int k=n;k>=0;k--){
		if(k*k*k > n) continue;
		for(int j=n;j>=0;j--){
			if(j*j + k*k*k > n) continue;
			int i = n - j*j - k*k*k;
			if(0 <= i && i <= n){
				int m = i+j+k;
				ans = min(ans, m);
			}
		}
	}
	cout<< ans<< endl;
	return true;
}

int main(){
	cout.setf(ios::fixed);
	cout.precision(10);
	while(solve());

	return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<math.h>
#define MAX 1000000;
using namespace std;

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

C++: #include<iostream>
using namespace std;
int main(){
  int n;
  while(cin>>n,n){
    int min=1000000;
    for(int i=0;i*i<=n;i++)for(int j=0;j*j*j<=n;j++)if(j*j*j+i*i<=n&&min>i+j+n-j*j*j-i*i)min=i+j+n-j*j*j-i*i;
    cout<<min<<endl;
  }
  return 0;
}

C++: #include <iostream>

int main()
{
	int e;
	while (std::cin >> e, e > 0) {
		int m = e;	// ツ可シツづ個値
		for (int y = 0; y < e; ++y) {
			for (int z = 0; z < e; ++z) {
				const int x = e - y * y - z * z * z;
				if (x < 0) { break; }
				const int m_ = x + y + z;
				if (m_ < m) { m = m_; }
			}
		}
		std::cout << m << std::endl;
	}
	return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <functional>
#include <set>
#include <sstream>
#include <map>
#include <queue>

using namespace std;
 
const double eps=1e-10;

const int dy[]={-1,-1,0,1,1, 1, 0,-1};
const int dx[]={ 0, 1,1,1,0,-1,-1,-1};


int main()
{
	long long e;
	while(cin>>e,e){
		long long res=10000000;
		for(long long z=0;z*z*z<=e;z++){
			for(long long y=0;z*z*z+y*y<=e;y++){
				long long x=e-z*z*z-y*y;
				res=min(res,x+y+z);
			}
		}
		cout<<res<<endl;
	}

	return 0;
}

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

const int inf = 1e9;

using namespace std;

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

        for (int z = 0; z * z * z <= e; ++z) {
            for (int y = 0; y * y <= e - z * z * z; ++y) {
                mi = min(mi, e - z * z * z - y * y + y + z);
            }
        }

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