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>

using namespace std;

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

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

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

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

int main(void){

  int e;

  while(1){
    int ans = 1000000000;
    cin >> e;
    if(e == 0) break;
    for(int x=0; x < sqrt(e)/5; x++){
      for(int y=0; y <= sqrt(e); y++){
	for(int z=0;z <= pow(e, 1.0 / 3.0); z++){
	  if(e == x + y*y + z*z*z){
	    ans = min(ans,x+y+z);
	    //	  cout << x << ' ' << y << ' ' << z << endl;
	  }
	}
      }
  }
    
    cout << ans << endl;
  }
  return 0;
}

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

//macro-----------------------------------------------------------------------------------------
#define rep(i,a,b) for(int i=a;i<b;i++)
#define revrep(i,a,b) for(int i=a;i>b;i--)
#define int long long

//constant--------------------------------------------------------------------------------------
const int inf = 100100100100000;
const int mod = 1000000007;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

//general_method--------------------------------------------------------------------------------
vector<int> cs(vector<int> arr){vector<int> ret = arr;rep(i,1,arr.size()){ret[i] += ret[i-1];}return ret;}
int ceil(int a, int b){if(a%b == 0) return a/b;else return a/b + 1;}
int digitlen(int i){int t = i;int count = 0;while(t){count += 1;t /= 10;}return count;}
int gcd(int m, int n){if((0== m)||(0 == n))return 0;while(m != n){if(m > n)m = m - n;else n = n - m;}return m;}
int lcm(int n, int m){return n*m/gcd(n,m);}

//io_method-------------------------------------------------------------------------------------
int input(){int tmp;cin >> tmp;return tmp;}
string raw_input(){string tmp;cin >> tmp;return tmp;}
string readline(){string s;getline(cin, s);return s;}
void print(int n){cout << n << endl;}
void print(vector<int> arr){cout << arr[0];rep(i,1,arr.size()) cout << " " << arr[i];cout << endl;}
void print(string s){cout << s << endl;}
void print(pair<int, int> p){cout << p.first << " " << p.second;}
void print(vector<vector<int>> arr){rep(i,0,arr.size()){print(arr[i]);}}
void print(double n){cout << n << endl;}

//main------------------------------------------------------------------------------------------


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

    while(true){
    int e = input();
    if(e == 0) break;
    int ans = inf;
    rep(i,0, 1000){
        rep(j,0, 1000){
            int x = e-i*i - j*j*j;
            if(x < 0) continue;
            ans = min(ans, x + i + j);
        }
    }
    print(ans);
    }
}

C++: #include <iostream>
#include <algorithm>
#include <cassert>
#include <cctype>
#include <complex>
#include <cstdio>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;

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

int e;

int main(){
	while(cin>>e&&e){
		int ans=9999999;
		rep(i,101)rep(j,1001){
			if(e-i*i*i-j*j>=0)ans=min(ans,e-i*i*i-j*j+i+j);
		}
		cout<<ans<<endl;
	}
}

C++: #include <iostream>
using namespace std;
int main(){
	int e;
	int x, y, z;
	int m;
	int xyz;
	while( 1 ){
		m = 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++ ){
				xyz = x + y*y + z*z*z;
				if( xyz == e && m > x + y + z ){
					m = x + y + z;
				}
			}
		}
		cout << m << endl;
	}
}

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

int main(void){
  int e,x,y,z,ans;
  while(cin>>e,e){
    ans=1e6;
    for(z=0;z*z*z<=e;++z){
      for(y=0;z*z*z+y*y<=e;++y){
          ans=min(ans,e-(z*z*z+y*y)+y+z);
      }
    }
    cout<<ans<<endl;
  }
  return 0;
}

C++: #include<stdio.h>
using namespace std;

int main(){
	long long sum , E;
	int y, z;
	while (scanf("%lld", &E), E){
		sum = 1000000;
		for (z = 0; z*z*z <= E; z++)
			for (y = 0; y*y <= E; y++){
				long long x = E - z*z*z - y*y;
				if (x<0){ break; }
				else if (sum>(x + y + z))sum = x + y + z;
			}
		printf("%lld\n", sum);
	}

	return 0;
}