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<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define it ::iterator
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double ESP=1e-10;
using namespace std;
int main(){
  int n;
  while(cin>>n,n){
    int mini=n;
    for(int z=0;z*z*z<=n;z++){
      int y=(int)sqrt(n-z*z*z);
      mini=min(mini,z+y+n-y*y-z*z*z);
    }
    cout<<mini<<endl;
  }
}

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

int solve(unsigned int E)
{
    int ans = INT_MAX;

    for (int z = 0; z * z * z <= E; ++z)
    {
        for (int y = 0; y * y <= E; ++y)
        {
            int x = (int)(E - y * y - z * z * z);

            if (x >= 0 && x + y * y + z * z * z == E)
            {
                ans = min(ans, x + y + z);
            }
        }
    }
    return ans;
}

int main()
{
    int E;
    while (cin >> E && E > 0)
    {
        cout << solve(E) << endl;
    }
}

C++: #include <iostream>

using namespace std;

int main() {
	int e,x,y,z,small ;
	z=0;
	small=1000000;
	while(cin >> e && e>0){
		while(z*z*z <= 1000000){
			y = 0 ;
			while(y*y <= 1000000){
				x = e-y*y-z*z*z;
				if(small >= x+y+z && x >= 0){
				small = x+y+z;
				}
			y = y+1;
			}
		z = z+1;
		}
	cout << small << endl ;
	}
}

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

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

    int m;
    while(cin >> m, m){
        int ans = 1000000;
        for(int z=0; z*z*z <= m; z++){
            for(int y=0; z*z*z+y*y <= m; y++){
                for(int x=0; z*z*z+y*y+x <= m; x++){
                    if(z*z*z+y*y+x == m) ans = min(ans, x+y+z);
                }
            }
        }
        cout << ans << endl;
    }
}

C++: #include<iostream>
#include<math.h>
using namespace std;
#define INF 1000000
int min(int a,int b){
	if(a<b){
		return a;
	}else {
		return b;
	}
}
int main(){
	int e;
	while(cin>>e&&e!=0){
		int m=INF;
		int x;
		for(int z=0;z*z*z<=e;z++){
			for(int y=0;z*z*z+y*y<=e;y++){
				x=e-z*z*z-y*y;
				m=min(m,x+y+z);
			}
		}
		cout<<m<<endl;
	}	
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
int main(void){
int e;
int x,y,z;
int minm;
while(true){
cin>>e;
if(e==0)break;
minm=1000000;
for(int i=0;i<1001;i++){
	for(int j=0;j<1001;j++){
		for(int k=0;k<101;k++){
			if(e==(i+j*j+k*k*k))minm=min(minm,i+j+k);
		}
	}
}
cout<<minm<<endl;
}
return 0;
}

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

using namespace std;

int main(){

  int e;

  while(cin>>e,e){

	int m=100000;

	  for(int z=0;z*z*z<=e;++z){
		for(int y=0;y*y<=e-z*z*z;++y){
		  int x=e-y*y-z*z*z;
		  m = min(m,x+y+z);
		}
	  }
	  
	  cout<<m<<endl;
	
  }
  
}

C++: // Space Coconut Crab
#include <iostream>
using namespace std;
int count = 0; // ?¨???¬??¨ global ?????°
int solve(int E) {
  // ?????´????±???????
  // x+y*y+z*z*z=E
  int ans = E; // ?????§??? 
  for (int z=0; z*z*z<=E; ++z)
    for (int y=0; y*y<=E-z*z*z; ++y){
        int x = E - y*y - z*z*z;
        ++count;
        if (x+y+z < ans) // x+y+z??????????°??????????ans?????´??°
            ans = x+y+z;
    }
  return ans;
}
int main() {
  int E;
  while (cin >> E && E>0) {
    cout << solve(E) << endl; 
  }
}
// ?????´?????????????????¨?????????????????????????????? 10^11???...8?§???\?????????

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 <= 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 <bits/stdc++.h>
using namespace std;

int main(){
	int n;
	cin >> n;
	while(n != 0){
		for(int i = 0;i*i*i < n; i++){
			for(int j = 0;j*j < n; j++){
				for(int k = 0;k < n; k++){
					if(i*i*i+j*j+k == n){
						cout << i+j+k<<endl;
						i = 1e9;
						j = 1e9;
						k = 1e9;
					}
				}
			}
		}
		cin >> n;
	}
	return 0;
}

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<=100; z++){
      for(y=0; y<=1000; y++){
	x = e-y*y-z*z*z;
	if(x>=0) minm = min(minm,x+y+z);
      }
    }
    cout<<minm<<endl;
  }
  return 0;
}

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

using namespace std;

int main(){
	vector<int> two, three;
	for (int i = 0; i * i < 1000000; i++) {two.push_back(i*i);}
	for (int i = 0; i * i * i < 1000000; i++) {three.push_back(i*i*i);}

	int e;
	while (cin >> e, e) {
		int tw, th;
		int min = e;

		for (int i = 0; three[i] <= e; i++) {
			for (int j = 0; three[i] + two[j] <= e; j++) {
				if (three[i] + two[j] <= e) {
					if (i + j + (e - three[i] - two[j]) < min) min = i + j + (e - three[i] - two[j]);	
				}	
			}	
		}
		cout << min << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <sstream>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <functional>
#include <iterator>
#include <limits>
#include <numeric>
#include <utility>
#include <cmath>
#include <cassert>
#include <cstdio>

// #include <unordered_set>
// #include <unordered_map>

#define rep(i, a, n) for(int i = a; i < n; i++)
#define REP(i, n) rep(i, 0, n)
#define repb(i, a, b) for(int i = a; i >= b; i--)
#define all(a) a.begin(), a.end()
#define SORT(c) sort((c).begin(),(c).end())
#define RSORT(c) sort((c).rbegin(),(c).rend())

#define pb push_back
#define mp make_pair

int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;}
int lcm(int a,int b){int c=gcd(a,b);a/=c;return a*b;}

typedef std::pair<int, int> P;
typedef long long ll;
typedef long double ld;

const int MOD = 1000000007;
const int INF = 1e9;
const ll LINF = INF * 1ll * INF;
const ld DINF = 1e200;
const double EPS = 1e-10;
const double PI  = acos(-1.0);

using namespace std;

#define int long long

signed main(){
  

    ios::sync_with_stdio(false);
    cin.tie(0);
    //cin高速化

    int e;



    while(cin>>e){

        int ans=INF;

        if(e==0)break;

        REP(i,100){
            if(i>e)break;
            REP(j,1000){
                if(j>e)break;
                REP(k,1000000){

                    if(k>e||(k+j*j+i*i*i)>e)break;
                    // cout<<i<<" "<<j<<" "<<k<<endl;

                    if(k+j*j+i*i*i==e){
                        ans=min(i+j+k,ans);
                    }
                }
            }
        }

        cout<<ans<<endl;


    }
    
}