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 <stdio.h>
  2 
  3 int e;
  4 
  5 int x, y, z;
  6 int m;
  7 
  8 int main(void)
  9 {
 10     while(1) {
 11         m = 1000000;
 12         y = 0;
 13         z = 0;
 14         scanf("%d", &e);
 15         if (e == 0) break;
 16         while (z * z * z <= e) {
 17             while (y * y <= e - z * z * z) {
 18                 x = e - y * y - z * z * z;
 19                 if (m > x + y + z) {
 20                     m = x + y + z;
 21                 }
 22                 y++;
 23             }
 24             y = 0;
 25             z++;
 26         }
 27         printf("%d\n", m);
 28     }
 29 }
~

C++: #include <cstdio>
#include <cstring>
#include <cmath>
#include <iostream>
#include <sstream>
#include <algorithm>
#include <numeric>
#include <functional>
#include <vector>
#include <queue>
#include <string>
#include <complex>
#include <stack>
#include <set>
#include <map>
#

#define REP(i,n) for (int i = 0; i < (n); i++)
#define RREP(i,n) for (int i = (n)-1; i >= 0; i--)
#define FOR(i,s,n) for (int i = (s); i < (n); i++)
#define ALLOF(c) c.begin(), c.end()
#define RANGEOF(c,i,n) c.begin() + (i), c.begin() + (i) + (n)
#define EPS 1e-9
#define INF 1000000000
using namespace std;

typedef complex<int> POINT;
template <class T>
class vevector : public vector<vector<T>>
{
public:
	using vector<vector<T>>::operator []; 
	T& operator [](const POINT &index) { return (*this)[index.real()][index.imag()]; }
};

template <class T> T read() { T t; cin >> t; return t; }
template <> POINT read<POINT>() { int x, y; cin >> x >> y; return POINT(x, y); }
template <class T> vector<T> read(int n) { vector<T> v; REP(i,n) { v.push_back(read<T>()); } return v; }
template <class T> vevector<T> read(int n, int m) { vevector<T> v; REP(i,n) v.push_back(read<T>(m)); return v; }
template <class T> void write(const T &t) { cout << t << endl; }
template <class T> void write(const T &t, const T &t2) { cout << t << ' ' << t2 << endl; }

template <class T> void write(const vector<T> &v)
{
	ostringstream ss; 
	for (auto x : v) ss << x << ' ';
	auto s = ss.str();
	cout << s.substr(0, s.length() - 1) << endl;
}

struct _Reader { template <class T> _Reader operator ,(T &rhs) { cin >> rhs; return *this; } };
#define READ(t,...) t __VA_ARGS__; _Reader(), __VA_ARGS__

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

vector<unsigned char> isPrime;
vector<int> primes;
void initPrimes(int n)
{
	isPrime = vector<unsigned char>(n + 1, true);
	isPrime[0] = isPrime[1] = false;
	FOR(i, 2, n)
	{
		if (!isPrime[i]) continue;
		primes.push_back(i);
		for (int j = i * 2; j <= n; j += i)
			isPrime[j] = false;
	}
}
/// template end ///

void solve()
{
	while (true)
	{
		READ(int, e);
		if (!(e)) { break; }
		
		int ez = pow(e, 1/3.0) + 2; // cbrt
		int ey = sqrt(e) + 2;
		
		int minimumM = INF;
		REP(z, ez) REP(y, ey) 
		{
			int x = e - z*z*z - y*y;
			if (x < 0) break;
			minimumM = min(minimumM, x + y + z);
		}
		write(minimumM);
	}
}

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

int main(){
    int n;
    while(cin >> n, n){
        int ans = 1<<30;
        for(int i=0; i*i*i <= n; i++){
            int j = sqrt(n - i*i*i);
            if(n < i*i*i + j*j) continue;
            ans = min(ans, i+j+(n-i*i*i-j*j));
        }
        cout << ans << endl;
    }
}

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

C++: #include <stdio.h>

// x + y*y + z*z*z = eð½·Æ«Ìx+y+zÌÅ¬Ìlðßé

int main(){
	int e,x,y,z,answer;

	while(1){
		answer=1000000;
		scanf("%d", &e);
		if(e==0)break;

		for(y=0 ; y<1000 ; y++){//(y*y)<1000000 <=> y<1000
			for(z=0 ; z<100 ; z++){//(z*z*z)<1000000 <=> z<100
				x = e - (y*y) - (z*z*z);
				if(x<0)continue;
				if(answer>x+y+z)answer = x+y+z;
			}
		}
		printf("%d\n", answer);//¦ÌoÍ
	}
	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <time.h>
#include <math.h>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <iterator>
#include <sstream>
#include <string>
#include <bitset>
using namespace std;
#define FOR(I,F,N) for(int I = F; I < (int)(N); I++)
#define rep(i, n) FOR(i, 0, n)
#define FIN(V) cout<<V<<endl
#define pb push_back
#define INF (1 << 28)

template<typename T>
void remove(vector<T>& vector, unsigned int index){
vector.erase(vector.begin() + index);
}

typedef pair<int, int> P;
typedef long long ll;
typedef priority_queue<int> pq;
int StrToInt(string);
string IntToStr(int);
int dx[4] = {1, -1, 0, 0};
int dy[4] = {0, 0, 1, -1};

int main(void){
	int e;
	while(cin >> e, e){
		int mini = e;
		for(int z = 0; e >= z*z*z; z++){
			for(int y = 0; e-z*z*z >= y*y; y++){
				int x = e - z*z*z - y*y;
				if(x < 0)continue;
				mini = min(mini, x+y+z);
			}
		}
		cout << mini << endl;
	}

	return 0;
}



int StrToInt(string s){
	stringstream ss;
	ss << s;
	int val;
	ss >> val;
	return val;
}
string IntToStr(int i){
	stringstream ss;
	ss << i;
	return ss.str();
}

C++: #include "bits/stdc++.h"

#define REP(i,n) for(int i=0;i<n;++i)
#define RREP(i,n) for(int i=n-1;i>=0;--i)
#define FOR(i,m,n) for(int i=m;i<n;++i)
#define RFOR(i,m,n) for(int i=n-1;i>=m;--i)
#define ALL(v) v.begin(),v.end()
#define PB(a) push_back(a)
#define INF 1000000001
#define MOD 1000000007

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

using namespace std;


int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	while (1) {
		int e, ans=INF;
		cin >> e;
		int c = e;
		if (!e) break;
		REP(i, 101) {
			REP(j, 1000) {
				if (pow(j, 2) + pow(i, 3) > e) break;
				REP(k, 1000000) {
					if (k + pow(j, 2) + pow(i, 3) > e) break;
					if (k + pow(j, 2) + pow(i, 3) == e) {
						ans = min(ans, i + j + k);
					}
					
				}
			}
		}
		cout << ans << endl;
	}
	return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;



int main(){

	int e;
	while(true){

		cin>>e;
		if(e==0) break;
		int x,y,z;
		int xm,ym,zm;
		int csum,msum=1000000;
		zm=(int) pow(e,1.0/3);
		//cout<<"zm"<<zm<<endl;
		for (int i = zm; i >=0; --i)
		{
			z=i;
			ym=(int)sqrt(e-pow(z,3));
			for (int j = ym; j >= 0; --j)
			{
				y=j;
				x=e-pow(z,3)-pow(y,2);
				csum=x+y+z;
				if(csum<msum){
					msum=csum;
				}
			}
		}
	}	
	cout<<msum<<endl;

	


return 0;
}

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

int main() {

  long long int e;

  while( true ) {

    cin >> e;

    if ( e == 0 ) break;

    long long int ans[3] = {0};

    for ( int i = 0; i < 3; i++ ) {

      while( true ) {

	if ( ans[0] * ans[0] * ans[0] + ans[1] * ans[1] + ans[2] > e ) {
	  ans[i]--;
	  break;
	}else {
	  ans[i]++;
	}

      }

    }

    cout << ans[0] + ans[1] + ans[2] << endl;

  }

  return 0;

}