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 <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 = 1<<10;
	for(int i=0;i<=n;i++){
		for(int j=0;j<=n;j++){
			if(i+j*j > n) break;
			for(int k=0;k<=n;k++){
				if(i+j*j+k*k*k > n) break;
				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 <iostream>
#include <cmath>
using namespace std;

int main() {
	int e;
	while(cin >> e && e > 0) {
		int x, y, z;
		int maxz, maxy;
		int min = 1000000;
		maxz = int(pow(e, 1.0/3.0));
		maxy = int(pow(e, 1.0/2.0));
		//cout << "maxz:" << maxz << endl;
		//cout << "maxy:" << maxy << endl;
		for(int z = 0; z <= maxz; z++) {
			for(int y = 0; y <= maxy; y++) {
				x = e - y*y - z*z*z;
				if(x >= 0 && x+y+z < min) min = x+y+z;
			}
		}
		cout << min << endl;
	}
}

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

int main(){
	long long sum=1000000;
	int x,y,z,E;
	while(1){
	cin >> E;
	if(E==0)break;
	for(z=0;z*z*z<=E;z++)
		for(y=0;y*y<=(z+1)*(z+1)*(z+1)-z*z*z;y++)
			for(x=0;x<(y+1)*(y+1)-y*y;x++){
			if(x+y*y+z*z*z==E)
			if(sum>x+y+z)sum=(x+y+z);
			}
	}
	cout << sum << endl;
        return 0;
}

C++: #define _USE_MATH_DEFINES
#include "bits/stdc++.h"
#define EPS 1e-10
using namespace std;
typedef long long llong;
int main() {
	int e;
	while (cin >> e, e) {
		int m=20000000;
		for (int x = 0; x <= e; x++) {
			for (int y = 0; x + (int)pow(y, 2) <= e; y++) {
				for (int z = 0; x + (int)pow(y, 2) + (int)pow(z, 3) <= e; z++) {
					if (x + (int)pow(y, 2) + (int)pow(z, 3) == e) {
						m = min(m, x + y + z);
					}
				}
			}
		}
		cout << m << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <cmath>
#include <string>
#include <sstream>
#include <iomanip>
#include <complex>
using namespace std;
 
#define ll long long
#define vvi vector< vector<int> >
#define vi vector<int>
#define All(X) X.begin(),X.end()
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define pb push_back 
#define pii pair<int,int>
#define mp make_pair
#define pi 3.14159265359
#define shosu(X) fixed << setprecision(X)
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

ll int pow(int a,int b){
  if(b == 2) return a*a;
  if(b == 3) return a*a*a;

  int ans = 1;
  REP(i,b) ans = ans * a;
  return ans;
}


int hoge(int e){

  int num;

  REP(a,e+1){
	REP(b,e+1){
	  REP(c,e+1){
		num = a + pow(b,2) + pow(c,3);
		//		cout << num << endl;
		if(num > e) break;
		if(num == e) return (a + b + c);
		
	  }
	}
  }
  
	return -1;

}

int main(){

  int e;

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

	cout << hoge(e) <<endl;

  }
}

C++: #include <iostream>
#include <math.h>
using namespace std;
int E;
int solve(int E);

int solve(int E) {
  int x,y,z3,z;
  int min = E;
  for (x=0;x<=E;x++) {
    for (y=0;y*y<=E-x;y++) {
      z3 = E-x-y*y;
      z = round(pow(z3,1.0/3.0));
      if (x+y*y+z*z*z==E && x+y+z<min) {
	min = x+y+z;
      }
    }
  }
  return min;
}
int main() {
  while (cin >> E && E>0) {
    cout << solve(E) << endl;
  }
}

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

inline bool isint(double x){
	int a=(int)x;
	if(a==x) return true;
	return false;
}

int main(){
	int e;
	while(cin >> e , e){
		int m=1e+9;
		for(int z=0 ,z1=0;z<=e;++z1 , z=pow(z1,3.)){
			for(int y=0 , y1=0;y<=e; ++y1 , y=pow(y1,2.)){
				int x=e-(y+z);
				if(x>=0 && isint(cbrt(z))) m= min(m , x+(int)sqrt(y)+(int)cbrt(z));
			}
		}
		cout << m << endl;
	}
	return 0;
}

C++: #include<stdio.h>

int main(){


int E;
while(1){
scanf("%d",&E);if(E==0)break;
int min=E;int m=E;
for(int i=0;i<=E;i++)
for(int j=0;j<=E;j++)
for(int k=0;k<=E;k++)
{if(i+j*j+k*k*k>E)break;
if(i+j*j+k*k*k==E&&i+j+k<=min)min=i+j+k;
}
printf("%d\n",min);
}
return 0;
}

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


int main() {
	int e;
	while (cin >> e && e>0) {
		int y=0;
		int z=0;
		int sum=0,summin=e; // min: NOTICE how we initialize the minimum

		for (y = 0; y*y+z*z*z <= e; ++y)
		{
			//cout << y << " " << z << endl;
			for (z=0 ; y*y+z*z*z <= e; ++z)
			{
				int x= e-y*y-z*z*z;
				sum = x+y+z;
				if (sum < summin) summin = sum;
       			//	cout << y << " " << z << endl;
			}
			z=0;
		}
		cout << summin << endl;
	}

	return 0;
}

C++: #include <iostream>

using namespace std;

int main()
{
  int s, t, u, e, m;

  while(cin>>e && e){
    bool f = true;
    for(int i = 0; i < 10000 && f; i++){
      for(int j = 0; j*j <= 1000000 && f; j++){
	for(int k = 0; k*k*k <= 1000000 && f; k++){
	  s = i+j*j+k*k*k;
	  if(s == e){
	    cout << (i+j+k) << endl;
	    f = false;
	  } else if(s > e){
	    break;
	  }
	}
      }
    }
  }

  return 0;
}