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 <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>

#include <functional>
#include <cassert>

typedef long long ll;
using namespace std;

#define mod 1000000007 //1e9+7
#define INF 1000000000 //1e9
#define LLINF 2000000000000000000LL //2e18
#define SIZE 1001

bool calc(){
  int e;
  int ans = INF;
  
  scanf("%d",&e);

  if(e==0) return false;

  for(int i=0;i*i*i<=e;i++){
    for(int j=0;j*j+i*i*i<=e;j++){
      ans = min(ans,j+i+(e-j*j-i*i*i));
    }
  }
      
  printf("%d\n",ans);
  
  return true;
}

int main(){
    
  while(calc());
  
  return 0;
}

C++: #include <iostream>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#include <list>
#include <vector>
#include <complex>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <bitset>
#include <ctime>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <cassert>
#include <cstddef>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <sstream>
#include <fstream>

using namespace std;
#define REP(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define FOR(i, a, b) for (int (i) = (a); (i) < (b); (i)++)
#define RREP(i, a) for(int (i) = (a) - 1; (i) >= 0; (i)--)
#define FORR(i, a, b) for(int (i) = (a) - 1; (i) >= (b); (i)--)
#define DEBUG(C) cerr << #C << " = " << C << endl;
using LL = long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VL = vector<LL>;
using VVL = vector<VL>;
using VD = vector<double>;
using VVD = vector<VD>;
using PII = pair<int, int>;
using PDD = pair<double, double>;
using PLL = pair<LL, LL>;
using VPII = vector<PII>;
#define ALL(a) begin((a)), end((a))
#define RALL(a) rbegin((a)), rend((a))
#define SORT(a) sort(ALL((a)))
#define RSORT(a) sort(RALL((a)))
#define REVERSE(a) reverse(ALL((a)))
#define MP make_pair
#define FORE(a, b) for (auto &&a : (b))
#define FIND(s, e) ((s).find(e) != (s).end())
#define EB emplace_back

const int INF = 1e9;
const int MOD = INF + 7;
const LL LLINF = 1e18;

void solve(int E) {
    int m = INF;
    REP(y, E) REP(z, E) {
        int x = E - (y * y) - pow(z, 3);
        if (x < 0) continue;
        m = min<int>(m, x + y + z);
    }
    cout << m << endl;
}

signed main(void) {
    int n, m, p, a, b, c, x, y, z, q;
    string s;
    while (cin >> n, n) {
        solve(n);
        //return 0;
    }
}

C++: #include <iostream>
#include <cmath>
using namespace std;
int E;
int main(){
  while(cin >> E && E>0){
    int m = 30000;
    for (int z=0; z<=cbrt(E); z++){
      if(z >= m) break;
        for(int y=0; y<= sqrt(E-z*z*z);y++){
	 if (y+z >= m) break;
	    int x = E - z*z*z - y*y;
	    if (x >= 0){
	      if(x+y+z < m){
		m = x+y+z;
	      }
	    }
      }
    }
    cout << m << endl;
  }
}

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

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

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

using namespace std;

int e;

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

		if (e == 0) break;

		int ret = 999999999;

		for (int z = 0; z * z * z <= e; z++)
		{
			for (int y = 0; y * y + z * z * z <= e; y++)
			{
				ret = min(ret, e - y * y + z * z * z + y + z);
			}
		}

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

C++: #include <iostream>
#include <cmath>
using namespace std;
int calcOver(int, int);
int calcM(int, int ,int);

int main() {
  while(true) {
    int e;
    cin >> e;
    if(e == 0) break;
    int y = 0;
    int z = 0;
    int maxover = 0;
    int limity = pow(e, 1.0 / 2.0) + 1;
    int limitz = pow(e, 1.0 / 3.0) + 1;
    int maxy = limity;
    int maxz = limitz;
    int minm = e;
    bool flag = false;
    //cout << limity << ":" << limitz << endl;
    for(y = limity; y >= 0; --y) {
      for(int z = limitz; z >= 0; --z) {
        int m = calcM(e, y, z);
        //if((y + z <= m) && (m <= y + z + e)) {
        if(e >= calcOver(y, z)) {
          //cout << y << ":" << z << ":" << ":" << m << endl;
          if(minm > m) {
            maxy = y;
            maxz = z;
            minm = m;
          }
          break;
        }
      }
    }
    //cout << maxy << ":" << maxz << endl;
    cout << minm << endl;
  }
  return 0;
}

int calcOver(int y, int z) {
  return (y*y + z*z*z);
}
int calcM(int e, int y, int z) {
  return (e - y*y - z*z*z + y + z);
}

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

int e,minimum;

int solve(){
    minimum = e;
    for(int z=0;z <= pow(e,1./3.);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<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#include<set>
#include<complex>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define CC puts("-------ok--------");
#define all(in) in.begin(), in.end()
#define bv vector<bool>
using namespace std;
typedef pair<int, int> PI;
#define MAX 1000009
int main(){
    int e;
    while(cin>>e,e){
        vector<PI> v3;
        for(int i =0;i<=100;i++){
            PI temp;
            temp.first=pow(i,3);temp.second=i;
            if(temp.first>e)break;
            v3.push_back(temp);
        }
        vector<PI> v2;
        for(int i=0; i<=10000;i++){
            PI temp;
            temp.first=pow(i,2); temp.second=i;
            if(temp.first>e)break;
            v2.push_back(temp);
        }
        PI min; min.first=INF; min.second=INF;
        for(int i=(int)v3.size()-1; i>=0;i--){
            if(v3[i].first==e){cout<<v3[i].second<<endl; goto E;}
            for(int j=(int)v2.size()-1; j>=0;j--){
                if(v2[j].first==e){cout<<v2[j].second<<endl;goto E;}
                if(v2[j].first+v3[i].first==e){cout<<v2[j].second+v3[i].second<<endl; goto E;}
                if(v3[i].first+v2[j].first<e){
                    if(min.first>e-(v3[i].first+v2[j].first)){
                        min.second=v3[i].second+v2[j].second;
                        min.first=e-(v3[i].first+v2[j].first);
                    }
                }
            }
        }
        cout<<min.second+min.first<<endl;
    E:;
    }
    return 0;
}

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

int main(){
  int e;
  while(cin >> e,e){
    int x,y,z;
    int m = 10000;
    for(int i=0; i*i*i<=e; ++i){
      for(int j=0; j*j<=e-(i*i*i); ++j){
	int k = e - j*j - i*i*i;
	    m = min(m,i+j+k);
	    
      }
    }
    cout << m << endl;
  }
  return 0;
}