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>
#include<algorithm>
using namespace std;

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

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

signed main(){
  cin.tie(0);
  ios::sync_with_stdio(false);

while(1){
  int e; cin >> e;
  if(e == 0) break;
  vector<int> v;
  const int n = 110;
  for(int x = 0; x < n; x++){
    for(int y = 0; y < n; y++){
      for(int z = 0; z < n; z++){
        if(x + y*y + z*z*z == e){
          v.push_back(x + y + z);
        }
      }
    }
  }
  sort(v.begin(),v.end());
  cout << v[0] << endl;
}

  return 0;
}

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

int main()
{
	int e;
	while (cin >> e,e)
	{
		bool f=1;
		for (int x=0; f&&x<=e; x++)
		for (int y=0; f&&y*y<=e; y++)
		for (int z=0; f&&z*z*z<=e; z++)
		{
			int a = x + y*y + z*z*z;
			if (a > e)
				continue;
			if (a == e)
			{
				cout << x+y+z << endl;
				f=0;
				break;
			}
		}
	}
}

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

int main() {
	int x, y, z, e, m;
	while (cin >> e && e > 0){
		m = 10000000;
		for (x = 0; x <= e; x++) {
			for (y = 0; y^2 <= e; y++) {
				int z = round(pow(e - x - y*y, 1 / 3));
				if (x + y*y + z*z*z == e)
					m = min (m, x + y + z);
			}
		}
		cout << m << endl;
	}
}

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

int main(){
while(1){//start
	
	int e;
	int ans = 100000000;
	cin >> e;
	
	if(e == 0)break;
	
	for(int x = 0; x < e; x++){
		for(int y = 0; y < 1000; y++){
			if(x + y*y > e) break;
			for(int z = 0; z < 100; z++){
				if(x + y*y + z*z*z > e) break;
				else if(x + y*y + z*z*z == e){
					ans = min(ans, x + y + z);
				}
			}
		}
	}
	
	cout << ans << endl;
	
}//ebd	
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
/*{{{*/  //template
#define REP(i,n) for(int i=0;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1<<29
#define LINF LLONG_MAX/3
#define MP make_pair
#define PB push_back
#define pb push_back
#define EB emplace_back
#define ALL(v) (v).begin(),(v).end()
#define all(v) ALL(v)
#define sz(x) (int)(x).size()
#define debug(x) cerr<<#x<<":"<<x<<endl
#define debug2(x,y) cerr<<#x<<","<<#y":"<<x<<","<<y<<endl
//struct fin{ fin(){ cin.tie(0); ios::sync_with_stdio(false); } } fin_;
struct Double{ double d; explicit Double(double x) : d(x){} };
ostream& operator<<(ostream& os,const Double x){ os << fixed << setprecision(20) << x.d; return os; }
template<typename T> ostream& operator<<(ostream& os,const vector<T>& vec){ os << "["; for(const auto& v : vec){ os << v << ","; } os << "]"; return os; }
template<typename T,typename U> ostream& operator<<(ostream& os,const pair<T,U>& p){ os << "(" << p.first << ","<< p.second <<")"; return os; }
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
ll gcd(ll a,ll b){ if(b==0) return a; else return gcd(b,a%b); }
constexpr double eps = 1e-14; 
constexpr ll mod = 1e9+7;
const int dx[]={1,0,-1,0} ,dy[] = {0,1,0,-1};
/*}}}*/

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

int main(){
    while(cin >> e){
        if(e==0) break;
        solve();
    }
}

C++: #include <iostream>
#include <iomanip>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <climits>
#include <cfloat>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <algorithm>
#include <functional>
#include <utility>
#include <numeric>

using namespace std;

typedef unsigned int UI;
typedef long long LL;
typedef unsigned long long ULL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int,int> PII;
typedef istringstream ISS;
typedef ostringstream OSS;

const int INF = INT_MAX / 4;
const double EPS = 1e-12;

#define REP( i, m, n ) for ( int i = (int)( m ); i < (int)( n ); ++i )
#define EACH( v, c ) for ( auto &v : c )

#define ITER( c ) __typeof( (c).begin() )
#define IREP( c, it ) for ( ITER(c) it = c.begin(); it != c.end(); ++it )
#define ALL( c ) (c).begin(), (c).end()

#define PB( n ) push_back( n )
#define MP( a, b ) make_pair( ( a ), ( b ) )
#define EXIST( c, e ) ( (c).find( e ) != (c).end() )

#define fst first
#define snd second

#define DUMP( x ) cerr << #x << " = " << ( x ) << endl
#define DEBUG( x ) cerr << __FILE__ << ":" << __LINE__ << ": " << #x << " = " << ( x ) << endl

int main()
{
	while ( true )
	{
		int e;
		cin >> e;

		if ( !e )
		{
			break;
		}

		ULL min = INT_MAX;

		for ( ULL y = 0; y * y <= e; y++ )
		{
			for ( ULL z = 0; z * z * z <= e; z++ )
			{
				LL x = e - z * z * z - y * y;

				if ( x < 0 )
				{
					break;
				}

				if ( x + y * y + z * z * z == e )
				{
					min = std::min( min, x + y + z );
				}
			}
		}

		cout << min << endl;
	}

	return 0;
}

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


int main() {
	int e;
	while (cin >> e && e>0) {
		int y=0;
		int z=0;
		int sum=0,summin=e; // min: NOTICE how we initialize it

		while (y*y*y+z*z*z<e) { // third power of something
			while (y*y*y+z*z*z<e) {
				x= e-y*y*y-z*z*z;	
				sum = x+y+z;
				if (sum < summin) summin = sum;
				++z;
			}
			++y;
		}
		cout << summin << endl;
	}

	return 0;
}

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

using namespace std;

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

C++: #include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
int main(){
	while(1){
		long long int num,ans=10000000;
		cin >> num;
		if(!num)	break;
		for(long long int y=0;y*y<=num;y++){
			for(long long int z=0;z*z*z+y*y<=num;z++){
				long long int x = num-z*z*z-y*y;
				ans = min(ans,(x+y+z));
			}
		}
		cout << ans << endl;
	}
}

C++: #include<iostream>

using namespace std;

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

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

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

using namespace std;

int main(){
	int e,m;
	while (cin >> e, e){
		m = 1000000;
		for (int i = 0; pow(i, 3) <= e; i++){
			for (int j = 0; (pow(i, 3) + pow(j, 2)) <= e; j++){
				int k = e - pow(i, 3) - pow(j, 2);
				m = min(m, i + j + k);
			}
		}
		cout << m << endl;
	}
}