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<vector>
#include<string>
#include<algorithm>
using namespace std;

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

C++: #include <iostream>

using namespace std;

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

C++: // Last Change: 11/07/2019 18:45:56.
#include <algorithm>
#include <array>
#include <bitset>
#include <cmath>
#include <complex>
#include <cstdlib>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;
using ll = long long;

ll ns_pow(ll val, ll n) {
  ll res = 1;
  for (ll i = 0; i < n; ++i) {
    res *= val;
  }
  return res;
}

int main() {
  ll e;
  while (cin >> e and e != 0) {
    ll x, y, z, m;
    m = numeric_limits<ll>::max();
    for (z = 0; ns_pow(z, 3) <= e; ++z) {
      for (y = 0; ns_pow(y, 2) + ns_pow(z, 3) <= e; ++y) {
        x = e - ns_pow(y, 2) - ns_pow(z, 3);
        if (x < 0) {
          continue;
          // break;
        }
        m = min(m, x + y + z);
      }
    }
    cout << m << endl;
  }
}

C++: #include <bits/stdc++.h>

using namespace std;

#define min(a, b) ((a) < (b)? (a):(b))
#define max(a, b) ((a) > (b)? (a):(b))
#define rep(i, n) REP(i, 0, (n))
#define REP(i, a, n) for(typeof(n) i=(a); i<(n); i++)

int main() {
    while(1) {
        int e; cin >> e;
        if(e == 0) break;
        int ans = 1000000;;
        rep(z, pow(e, 1.0/3.0)+1) {
            rep(y, sqrt(e)+1) {
                int x = e - y*y - z*z*z;
                if(x < 0) break;
                ans = min(ans, x + y + z); 
            }
        }
        cout << ans << endl;
    }
}

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;}

int main(){
	const int intmax  = 1000010;
	ll int e;
	while(cin >> e,e){
		ll int ans = 9999999;
		FOR(y,0,sqrt((double)e)+1){
			FOR(z,0,cbrt((double)e)+1){
				if(e-y*y-z*z*z>=0) ans = min(ans,y+z+(e-y*y-z*z*z));
			}
		}
		cout << ans << endl;
	}
	
}

C++: #include <iostream>

#define FOR(i,l,n) for(int (i)=(l);(i)<(n);(i)++)
#define REP(i,n) FOR(i,0,n)

using namespace std;

int main(){
    long int x,y,z,e,m;
    while(cin>>e,e){
        m=e;
      for(y=0;y*y<=e;y++){
          for(z=0;z*z*z<=e;z++){
              x = e-y*y-z*z*z;
              m = m<x+y+z?m:x+y+z;
          }
      }  
        cout<<m<<endl;
    }
    return 0;
}

C++: #include <iostream>
#include <cmath>
using namespace std;
int main(){
  int e,m;

  while(cin >> e && e>0){
      m=e;
    for(int z=0; pow(z,3)<=e; z++){
      for(int y=0; pow(z,3)+pow(y,2)<=e; y++){
        //int z=e-x-pow(y,2);
        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 <math.h>
using namespace std;
int E;
int solve (int e) {
	int mi = e;
	for (int x = 0; x <= e ; x++) {
		for (int y = 0; y*y <= e ; y++) {
			int z = round(pow(e - x - y*y,1.0/3.0));
			if (x + y*y + z*z*z == e) {
				mi = min(mi,x+y+z);
			}
		}
	}
	return mi;
}
int min(int a,int b) {
	if (a<b) return a;
	else return b;
}
int main() {
	while (cin >> E && E > 0 ) {
		cout << solve(E) << endl;
	}
}

C++: #include <iostream>
#include <cmath>
using namespace std;
int E;
int main(){
  while(cin >> E && E>0){
    int m = 1000000;
    for (int z=0; z<=100; z++){
      for(int y=0; y<=1000;y++){
	int x = E - pow(z,3) - pow(y,2);
	if (x>=0){
	  int n = x+y+z;
	  if(n < m && m > 0){
	    m = n;
	  }
	}
      }
    }
    cout << m << endl;
  }
}

C++: #include <bits/stdc++.h>

#define REP(i, n) for(int i = 0; i < (int) (n); i++)
#define ALL(v) (v).begin(), (v).end()
#define INF 1e9

using namespace std;

int main(){
  int e;
  while(cin >> e and e){
    int res = INF;
    REP(i, 105){
      int ne = e;
      if(pow(i, 3) > ne) break;
      ne -= pow(i, 3);
      REP(j, 1005){
        int nne = ne;
        if(pow(j, 2) > nne) break;
        nne -= pow(j, 2);
        res = min(i + j + nne, res);
      }
    }
    cout << res << endl;
  }
  return 0;
}

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

#define INF (1<<29)

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

C++: #include <stdio.h>
#include <iostream>
#include <queue>
#include <map>
#include <string>
#include <vector>
#include <algorithm>
#include <math.h>
#define PB push_back
#define in scanf
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
using	namespace std;
void solve(){
	int e;
	while(cin >> e ,e!=0) {
	int m =1000000000;
	int x;
	REP(z,(int)pow(e,1/3)+10){
		REP(y,(int)pow(e,1/2)+10){
			x = e-pow(y,2)-pow(z,3);
			if(x>=0)m = min(x + y + z,m);
				
		}
	}
	cout << m  << endl;
	
}
}



	
int main(){
	solve();

}

C++: #include<iostream>

using namespace std;

int main(){
  int e;
  int minimum = 10000000, n= 0;
  while(1){
    minimum = 10000000;
    cin >> e;
    if(e == 0) break;
    for(int i = 0; i<100; i++){
      for(int j = 0; j<1000; j++){
	n = e - i*i*i -j * j;
	if(n+ i+ j < minimum && n> 0) minimum = n+ i+ j;
      }
    }
    cout << minimum << endl;
  }
  return 0;
}

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



int main(){
	int e;
	int minimum = 0;
	cin >> e;
	while(e != 0){
		for(int z = 0; z * z * z <= e; z++){
			for(int y = 0; y * y <= e; y++){
				if(ceil(e - y * y - z * z * z) == floor(e - y * y - z * z * z)){
					minimum = min(minimum, e - y * y - z * z * z + y + z);
				}
			}
		}
		cout << minimum << endl;
		cin >> e;
	}

	return 0;
}