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

int main(){
    int n;
    while(cin >> n, n){
        int ans = 1000000;
        for(int i=0; i < 1000; i++){
            if(n < pow(i, 2)) break;
            for(int j=0; j < 100; j++){
                if(n-pow(i, 2)-pow(j, 3) < 0) continue;
                ans = min(ans, i+j+(int)(n-pow(i, 2)-pow(j, 3)));
            }
        }
        cout << ans << endl;
    }
}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <string>
#include <algorithm>
#include <cmath>

using namespace std;

int main (int argc, char *argv[]) {
    int e;
    while (cin>>e, e) {
        int m = 1000000000;
        for (int z = 0; pow(z, 3) <= e; ++z) {
            for (int y = 0; pow(y, 2) <= e - pow(z, 3); ++y) {
                int x = e - pow(y, 2) - pow(z, 3);
                m = min(m, x + y + z);
            }
        }
        cout<<m<<endl;
    }
    return 0;
}

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

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

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

int e = 0;
int main(void){
    int x, y, z;

    while(true){
        std::cin >> e;
        if(e == 0) break;
    int z_max = pow(e, 0.34);
    int y_max = pow(e, 0.5);
    int res = INT_MAX;
    for(z = 0; z <= z_max; ++z){
        for(y = 0; y <= y_max; ++y){
            for(x=0; x <= e; ++x){
                if((x + y*y + z*z*z) == e){
                    res = std::min(res, x+y+z);

                }
            }
        }
    }
    std::cout << res << std::endl;
    }
}

C++: #include <stdio.h>
#include <math.h>

int main(void){
	int y, z, e, min;
	while(1){
		scanf("%d",&e);
		if(e == 0)
			break;
		min = 0x7FFFFFFF;
		for(z = 0;pow((double)z,3) <= e;z++){
			for(y = 0;pow((double)z,3) + pow((double)y,2) <= e;y++){
				if(min > z + y + (e - pow((double)z,3) - pow((double)y,2)))
					min = z + y + (e - pow((double)z,3) - pow((double)y,2));
			}
		}
		printf("%d\n",min);
	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <utility>

#define INF 999999999
#define mod 1000000007

#define rep(i,n) for(int i=0;i<int(n);i++)
#define REP(i,a,b) for(int i=(a);i<int(b);i++)
#define all(x) (x).begin(),x.end()
#define pb push_back
#define MOD(x) (x%(mod))
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int,int>pi;

/*---------------------------------------------------*/

int main(){
  int n;
  while(cin>>n){
    if(n==0)break;
    int mini=INF;
    rep(y,sqrt(n)){
      rep(z,sqrt(n)){
	int x=n-y*y-z*z*z;
	if(x<0)continue;
	//cout<<x<<" "<<y<<" "<<z<<endl;
	mini=min(mini,x+y+z);
      }
    }
    cout<<mini<<endl;
    
  }
  return 0;
}

C++: #include<stdio.h>
#include<math.h>
#include<algorithm>
using namespace std;
int main(){
	int a;
	while(scanf("%d",&a),a){
		int ret=99999999;
		for(int i=0;i*i*i<=a;i++){
			int t=(sqrt(a-i*i*i)+0.0000001);
			ret=min(ret,i+t+(a-i*i*i-t*t));
		}
		printf("%d\n",ret);
	}
}

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

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

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

using namespace std;

int main(){
  int e;
  while(scanf("%d",&e),e){
    int x,y,z,ans=10000000;
    for(z=100; z>=0; z--){
      if(z*z*z>e) continue;
      
      for(y=0; y*y<=e-z*z*z; y++){
	x = e-y*y-z*z*z;
	ans = min(ans,x+y+z);
      }
    }
    printf("%d\n",ans);
  }
}

C++: #define _USE_MATH_DEFINES
#define INF 0x3f3f3f3f
#include <cstdio>
#include <iostream>
#include <sstream>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>
#include <list>
#include <cctype>
#include <utility>
 
using namespace std;
 
typedef long long ll;
typedef pair <int,int> P;
typedef pair <int,P > PP;
 
static const int tx[] = {0,1,0,-1};
static const int ty[] = {-1,0,1,0};
 
static const double EPS = 1e-8;

int main(){
  int e;
  while(~scanf("%d",&e)){

    int res = INF;
    for(int z=0;e-z*z*z>=0;z++){
      for(int x=0;x<=e-z*z*z;x++){
	int tmp = e-z*z*z-x;
	int y = (int)sqrt((double)tmp+EPS);
	if(tmp == y*y){
	  res = min(res,x+y+z);
	}
      }
    }

    printf("%d\n",res);
  }
}

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

typedef long long ll;
typedef pair<int,int> P;

#define MAX 1145141919

int main(){
        ll e;
        bool ok=false;
        while(cin>>e&&e){
                ll ans=MAX;
                for(ll i=0;i<=1000;i++){
                        for(ll j=0;j<=1000;j++){
                                ll x=e-i*i-j*j*j;
                                if(x<0)continue;
                                ll tmp=x+i+j;
                                if(tmp<ans)ans=tmp;
                        }
                }
                cout<<ans<<endl;
        }
        return 0;
}

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

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

C++: #include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>

#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1<<30

using namespace std;
typedef long long ll;

int main()
{
    int n;
    while(cin >> n && n) {
        int ans = INF;
        rep(i,100) {
            if(i*i*i > n) break;

            rep(j,100) {
                if(i*i*i + j*j > n) break;
                ans = min(ans,i+j+(n - i*i*i - j*j));
            }
        }

        cout << ans << endl;
    }

    return 0;
}

C++: #include <iostream>
#include <math.h>
using namespace std;
int e;
int main(){
  for(;;){
    cin >> e ;;
    int m = e;
    if(e == 0) break;
    for(int y=0; pow(y,2) <= e; y++){
      for(int z=0; pow(y,2) + pow(z,3) <= e; z++){
	int x = e - pow(z,3) - pow(y,2);
	if( x + y + z < m){
	  m = x+y+z;
	}
      }
    }
    cout << m << endl;
  }
}

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

int solve (int e) {
  int min = e;
  for (int l=e + 1; l >= 0; l--) {
    for (int k = e - l*l*l + 1; k >= 0; k--) {
      for (int i = e - l*l*l - k*k + 1; i >= 0 ; i--) {
        if (i + k*k + l*l*l == e && min > i + k + l) {
          return i + k + l;
        }
      }
    }
  }
  return min;
}

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