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

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

C++: #include<iostream>
#include<algorithm>
using namespace std;
#define LIM 1000000

int main() {
	int e;
	while (cin >> e, e) {
		int m = LIM;
		for (int x = 0; x <= LIM; x++) {
			for (int y = 0; x + y*y <= LIM; y++) {
				for (int z = 0; x + y*y + z*z*z <= LIM; z++) {
					if ((x + y*y + z*z*z) > e) break;
					else if ((x + y*y + z*z*z) == e) m = min(m, x + y + z);
				}
			}
		}
		cout << m << endl;
	}
	
}

C++: #include <iostream>
#include<math.h>
using namespace std;
int main() {
	 int e;
	cin >> e;

	while (e!=0) {
		int min = e;
		double e3 = pow(e, 1.0 / 3.0), e2 = pow(e, 1.0 / 2.0);
		for (int z = 0; z <= e3; z++) {
			for (int y = 0; y <= e2; y++) {
				int x = e - y*y - z*z*z;
				if (x < 0)break;
				int a = x + y + z;
				if (a < min)min = a;
			}
		}
		cout << min << endl;
		cin >> e;
	}
}

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

int main(){
	int e,m,a;
	
	while(1){
		cin >> e;
		m=e;
		if(e==0){
			return 0;
		}
		for(int i=0;i<e;i++){
			for(int j=0;j<e;j++){
				a=e-i*(i-1)-j*(j-1)*(j+1);
				if((a>=i+j)&&(m>a)&&(a>=0)){
					m=e-i*(i-1)-j*(j-1)*(j+1);
				}
			}
		}
		cout << m <<"\n";
	}
			
return 0;
}

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

int e,minimum;

int solve(){
    minimum = e;
    for(int z=0;z*z*z<=e;z++){
        for(int y=0;y <= sqrt(e);y++){
            int x = e - z*z*z - y*y;
            if(x>=0)
                minimum = min(x+y+z,minimum);
        }
    }
    return minimum;
}

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

C++: 
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <stack>
#include <cctype>
#include <complex>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <cassert>

using namespace std;


bool solve(){
	int n;
	cin>> n;
	if(!n) return false;
	int ans = 1000000;
	for(int k=0;k<=n;k++){
		if(k*k*k > n) break;
		for(int j=0;j<=n;j++){
			if(j*j + k*k*k > n) break;
			for(int i=0;i<=n;i++){
				if(n == i + j*j + k*k*k){
					int m = i+j+k;
					ans = min(ans, m);
				}
			}
		}
	}
	cout<< ans<< endl;
	return true;
}

int main(){
	cout.setf(ios::fixed);
	cout.precision(10);
	while(solve());

	return 0;
}

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

#define rep(i,n)  for(int i = 0; i < (n); i++)
using vi = vector<int>;
using ll = long long;
const int inf = 1<<30;

int main(){
  int e;
  while(cin >> e, e){
    int m = inf;
    rep(z,101) rep(y,1001){
      int x = e - z*z*z - y*y;
      if(0 <= x){
	m = min(m, x+y+z);
      }
    }
    cout << m << endl;
  }
}

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

using namespace std;

int max(int ,int );

int main(void){
  int min,x=0;
  int e;
  cin >> e;
 
  while(e!=0){
    min=e;
    for(int z=0;z<pow(e,1.0/3.0);z++){
      for(int y=0;y <= sqrt(e - z*z*z) ;y++){
	x = e - z*z*z - y*y;
	if(x+y+z<min) min = x+y+z;
      }
    }
      
    cout << min << endl;
    cin >> e;
  }
  return 0;
}

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

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

C++: #include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
#include <queue>

#pragma warning( disable: 4996 )

using namespace std;

typedef long long ll;

#define INF 100000000
#define EPS 1e-9

#define MAX_N 1000000

vector<int> ans_list;

int main(){

	

	while (true){
		
		int e;
		cin >> e;
		if (e == 0)
			break;

		for (int i = 0; ; i++){
			if (e < i)
				break;
			for (int j = 0;; j++){
				if (i + j*j > e)
					break;
				for (int k = 0;; k++){
					if (i + j*j + k*k*k > e)
						break;
					if (i + j*j + k*k*k == e){
						ans_list.push_back(i + j + k);
						i = j = k = e;
						break;
					}
				}
			}
		}

	}

	for (int i = 0; i < ans_list.size(); i++){
		cout << ans_list[i] << endl;
	}

	return 0;

}

C++: #include <cstdio>

int main(void)
{
    int e;
    int x, y, z, xyz;
    while(scanf("%d", &e), e != 0){
        for(xyz = 1; xyz <= e; xyz++){
            for(x = 0; x <= xyz; x++){
                for(y = 0; x + y <= xyz; y++){
                    z = xyz - x - y;
                    if(x + y * y + z * z * z > e){
                        break;
                    }else if(x + y * y + z * z * z == e){
                        printf("%d\n", xyz);
                        x = xyz = e;
                        break;
                    }
                }
            }
        }
    }
    return 0;
}

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

int main(void){
  ios::sync_with_stdio(false);
  cin.tie(0);
  int e;
  while(cin >> e, e){
    int x, y, z;
    int ans = INT_MAX;
    for(z = 0; z*z*z <= e; z++){
      y = sqrt(e-pow(z, 3));
      x = e - pow(z, 3) - pow(y,2);
      ans = min(ans, x+y+z);
    }
    cout << ans << endl;
  }
  return 0;
}

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

using namespace std;

int max(int ,int );

int main(void){
  int e,min,zzz,ez,ezy,x=0;
  cin >> e;
 
  while(e!=0){
    min=e;
    zzz = pow(e,1.0/3.0);
    for(int z=0;z<=zzz;z++){
      ez = e -z*z*z;
      for(int y=0;y*y <= ez ;y++){
	x = ez - y*y;
	if(x+y+z<min) min = x+y+z;
	if(y>min) y = e;
      }
      if(z>min) z = e;
    }
      
    
    cout << min << endl;
    cin >> e;
  }
  return 0;
}

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

int main(){
  int e;

  while(cin>>e,e){
    if(e==1) cout << e << endl;
    else{
      int x=e,y=(int)pow((double)e,1.0/2.0),z=(int)pow((double)e,1.0/3.0),m=x;
      for(int i=0;i<=y;i++){
        for(int j=0;j<=y;j++){
          for(int k=z;k>=0;k--){
            if(i+(int)pow((double)j, 2.0)+(int)pow((double)k, 3.0)==e&&m>i+j+k){
              m=i+j+k;
              break;
            }else if(i+(int)pow((double)j, 2.0)+(int)pow((double)k, 3.0)>e){
              break;
            }
          }
          if(i+(int)pow((double)j, 2.0)>e) break;
        }
      }
      cout << m << 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 x = 0; x < 1000000L; x++)
		{
			for (long y = 0; y <= e - x; y++)
			{
				for (long z = 0; z <= e - x - (y * y); z++)
				{
					if (e == x + y * y + z * z * z)
					{
						m = min(m, x + y + z);
					}
				}
			}
		}

		cout << m << endl;
	}


	return 0;
}