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>

using namespace std;

int main(void) {
	int e;
	while(1) {
		cin >> e;
		if(e == 0) {
			break;
		}
		
		int tmpx, tmpy, tmpz, tmpe;
		tmpe = e;
		tmpz = pow(e, 1.0 / 3.0);
		tmpe = tmpe - pow(tmpz, 3);
		if(tmpe == 0){
			tmpy = 0; tmpx = 0;
		}else{
			tmpy = pow(tmpe, 1.0 / 2.0);
			tmpe = tmpe - pow(tmpy, 2);
			if(tmpe == 0){
				tmpx = 0;
			}else{
				tmpx = tmpe;
			}
		}
		int tmpm = tmpx + tmpy + tmpz;

		int tmp, m = 100000;
		for(int z = 0; z <= tmpm; z++) {
			for(int y = 0; y <= pow(e - pow(z, 3), 1.0 / 2.0)); y++) {
				int x = e - pow(y, 2) - pow(z, 3);
				tmp = x + y + z;
				if(tmp < m) {
					m = tmp;
				}
			}
		}

		cout << m << endl;
	}
	return 0;
}

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

int solve (int e) {
  int num;
  long long int min = e;
  for (long long int l= round(pow(e, 1.0/3.0)) + 1; l >= 0; l--) {
    for (long long int k = round(sqrt(e - l*l*l)) + 1; k >= 0; k--) {
      for (long long int i = e - l*l*l - k*k + 1; i >= 0 ; i--) {
        if (i + k*k + l*l*l == e && min > i + k + l) {
          min = i + k + l;
          num = k;
          break;
        }
      }
    }
  }
  int k = num;
  for (long long int l2 = round(sqrt(e - k*k*k)) + 1; l2 >= 0; l2--) {
    for (long long int i = e - l2*l2 - k*k*k + 1; i >= 0 ; i--) {
      if (i + k*k*k + l2*l2 == e && min > i + k + l2) {
        min = i + k + l2;
        break;
      }
    }
  }
  return min;
}

int main () {
  long long int e;
  cin >> e;
  if(e == 0){
    return 0;
  }
  cout << solve(e) << endl;
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
#define INF 9999999

int main(){
    int e;
    
    while(cin >> e,e){
        //x+y^2+z^3=e
        int ans = INF;
        
        for(int z = 0 ; z*z*z <= e ; z++){
            for(int y = 0 ; (y*y)+(z*z*z) <= e ; y++){
                for(int x = 0 ; x+(y*y)+(z*z*z) <= e ; x++){
                    if(x+(y*y)+(z*z*z)==e) ans = min(ans,x+y+z);
                }
            }
        }
        
        cout << ans << endl;
    }
    
    return 0;
}

C++: #include<iostream>
#include<algorithm>
#define MAX 10000000L;
using namespace std;

int main()
{
	long e;
	while (cin >> e && e != 0)
	{
		long m = MAX;
		for (long z = 0; z * z * z < 1000000L; z++)
		{
			for (long y = 0; y * y<= e - z * z * z; y++)
			{
				for (long x = 0; x <= e - y * y - (z * z * z); x++)
				{
					if (e == x + y * y + z * z * z)
					{
						m = min(m, x + y + z);
					}
				}
			}
		}

		cout << m << endl;
	}


	return 0;
}

C++: #include <iostream>

using namespace std;

int main() {
	int e,x,y,z,small ;
	z=0;
	small=10000000;
	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){
				small = x+y+z;
				}
			y = y+1;
			}
		z = z+1;
		}
	cout << small << endl ;
	}
}

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

int main(){
    while(true){
        int e;
        int min = INT_MAX;
        cin >> e;
        if(e==0) break;
        for(int z=0; z < cbrt(e)+1; z++){
            for(int y=0; y < sqrt(e-z*z*z)+1; y++){
                if(e-z*z*z-y*y >= 0){
                    int tmp = z+y+(e-z*z*z-y*y);
                    if(tmp < min) min = tmp;
                }
            }
        }
        cout << min << endl;
    }
    return 0;
}

C++: #include <iostream>
#include <stdlib.h>
using namespace std;
int main()
{
  int E,z,y,x;
  while (cin >> E && E>0){
    if (E>1000000){
    cout << "Incorrect input" << endl;
    exit(1);
    }
    int	min=10000000;
    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(min > x+y+z)
          min=x+y+z;
      }
    }
    cout << min << endl;
  }
}

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

using namespace std;

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

    while (cin >> e) {
        if (!e) { break; }
        ans = e;

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

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

int solve (int e) {
  int min = e;
  for (int l=0; l < pow(e, 1.0/3.0) + 1; l++) {
    for (int k = 0; k < sqrt(e - l*l*l) + 1; k++) {
      for (int i = 0; i < e - l*l*l - k*k + 2; i++) {
        if (i + k*k + l*l*l == e && min > i + k + l) {
          min = i + k + l;
        }
      }
    }
  }
  return min;
}

int main () {
  long long int e;
  cin >> e;
  cout << solve(e) << endl;
}

C++: #include<bits/stdc++.h>
#define _ ios_base::sync_with_stdio(0);cin.tie(0);
#define REP(i,n) for(int i=0;i<(int)(n);i++)

using namespace std;

int main(){ _;
  int e;
  while(cin>>e,e!=0){
    int m=1<<29;
    REP(i,101){
      if(i*i*i>e) break;
      REP(j,1001){
	if(i*i*i+j*j>e)break;
	m=min(m,i+j+(e-i*i*i-j*j));
      }
    }
    cout<<m<<endl;
  }
}

C++: #include <algorithm>
#include <iostream>
#include <string>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <iomanip>
#include <limits>
#include <map>
#include <queue>
#include <stack>
#include <vector>

#define FOR(i,k,n) for(int (i) = (k); (i) < (n); ++(i))
#define rep(i,n) FOR(i,0,n)
#define pb push_back
#define all(v) begin(v), end(v)
#define debug(x) cerr << #x << ": " << x << endl
#define debug2(x,y) cerr << #x << ": " << x << ", " << #y << ": " << y << endl

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;
typedef pair<i_i, int> p_i;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
template<class T> using vv=vector<vector<T>>;
typedef deque<int> di;
typedef deque<deque<int>> ddi;


int main() {
    while(1) {
        int e;
        cin >> e;
        if(e == 0) {
            break;
        }
        int min = 1000000;
        for(int z = 0; z*z*z <= e; z++) {
            for(int y = 0; y*y <= e-z*z*z; y++) {
                int tmp  = e-y*y-z*z*z + y + z;
                if(tmp < min){
                    min = tmp;
                }
            }
        }
        cout << min << endl;
    }
	return 0;
}

C++: #include <cstdio>
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
int main(void){
  while(1){
    int e,m = 1111111;
    cin >> e; if(!e) break;
    for(int i = 0; i*i*i <= e; i++){
      int ee = e - i*i*i;
      for(int j = 0; j*j <= ee; j++){
	m = min(m,i+j+ee-j*j);
      }
    }
    cout << m << endl;
  }
}

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

int main(){
  int e;
  while(1){
    cin>>e;
    if(e==0)break;
    int m1=0,m=1000;
    for(int i=0;i<=e;i++)
      for(int j=0;j<=(e-i);j++)
	for(int k=0;k<=(e-i-j);k++)
	  if(e==i+(j*j)+(k*k*k)){
	    m1=i+j+k;
	    if(m>m1)m=m1;
	  }
    cout<<m<<endl;
  }
  return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
	int n;
	//x+y*y+z*z*zの、xが最少となるyとzの組み合わせを探す。
	while(cin>>n,n){
		int ans=10e8,now=n,now2=n,ans2=0,tmp=10e8;
			for(int i=0;i*i<=n;i++){
				for(int j=0;j*j*j<=n;j++){
					if(n-i*i-j*j*j>=0){
						tmp=min(n-i*i-j*j*j,tmp);
						ans=min(i+j+(n-i*i-j*j*j),ans);
					}
				}
			}
			cout<<ans<<endl;
		}
		return 0;
	}