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>
#include <algorithm>
#include <climits>

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

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

        res = INT_MAX;
        for(x=0; x<=e; ++x){
            y_max = pow(e - x, 0.5);
            for(y=0; y<=y_max; ++y){
                z_max = pow(e - x - y*y, 0.34);
                for(z=0; z<=z_max; ++z){
                    if((x+y*y+z*z*z) == e){
                        res = std::min(res, x+y+z);
                    }
                }
            }
        }
        std::cout << res << std::endl;
    }
}

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

signed main(){
  cin.tie(0);
  ios::sync_with_stdio(false);

  vector<int> v(1000001,1 << 30);
  const int n = 400;
  for(int x = 0; x < n; x++){
    for(int y = 0; y < n; y++){
      for(int z = 0; z < n; z++){
        if(x + y*y + z*z*z > 1000001) continue;
        v[x + y*y + z*z*z] = min(v[x + y*y + z*z*z],x + y + z);
      }
    }
  }

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

  cout << v[e] << endl;
}

  return 0;
}

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<bits/stdc++.h>
#define rep(i,N) for(int i=0;i<(N);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
using namespace std;
const long long MOD = 1e9 + 7;
const long long INF = 1e12;
const int inf = 1e9;
typedef long long ll;
typedef pair<ll,int> P;
typedef set<int> S;
ll n;
int main(){
    ll e;
    while(1){
        cin>>e;
        if(e==0) break;
        ll x,y,z;
        ll min=inf;
        for(int i = 0;i < 101; i++){
            for(int j = 0;j < 1001; j++){
                int k=e-i*i*i-j*j;
                if((i>=0 && j>=0 && k>=0) && (i+j+k<min)) min=i+j+k;
            }
        }
        cout<<min<<endl;
    }
    return 0;
}

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

int main(){

  while(cin >> E && E > 0 ){
    int min = 1000001; 
    for (int z = 0; z*z*z < E; ++z){
      for (int y = 0; y*y < E - z*z*z ; ++y){
        int x = E - z*z*z - y*y;
        if( x + y + z < min ) min = x + y + z ;
      }
    }
    cout << min << endl;
  }
return 0;
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
#define INF 9999999

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

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

#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<pii, int> ppi;

#define INF 1000000000

int solve2(int xy){
  int y=0;
  int ans=INF;
  while(y*y<=xy){
    ans=min(ans, y + xy-y*y);
    y++;
  }
  return ans;
}

void solve(int e){
  int z=0;
  int ans=INF;
  while(z*z*z<=e){
    ans = min(ans, z+solve2(e-z*z*z));
    z++;
  }
  cout << ans << endl;
}

int main(){
  while(true){
    int e;
    scanf("%d", &e);
    if(e==0) break;
    solve(e);
  }
}

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

using namespace std;

#define rep(i, n) for(int i=0; i<(n); i++)
#define FOR(i, m, n) for(int i=(m);i<(n);i++)
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define SORT(x) sort((x).begin(),(x).end())
#define REVE(x) reverse((x).begin(),(x).end())
#define mp make_pair
#define pb push_back

typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<vector<int>> VVI;
typedef pair<int, int> PII;
typedef long long LL;

//べき剰余
long long modpow(long long x, long long n, long long m) {
	long long ans = 1;
	while (0 < n) {
		if (n % 2 == 0)x = x * x%m, n >>= 1;
		else ans = ans * x%m, n--;
	}
	return ans;
}

vector<long long> v = { 2,7,61 };

//ミラー-ラビン素数判定法
bool Miller_Rabin(long long n) {
	if (n == 2)return true;
	if (n < 2 || n % 2 == 0)return false;

	long long d = n - 1, s = 0;
	while (d % 2 == 0)
		d /= 2, s++;


	for (auto a : v) {
		if (a == n)return true;
		bool flag = false;
		long long r = modpow(a, d, n);
		if (r == 1 || r == n - 1)flag = true;
		for (int j = 0; j < s; j++) {
			r = modpow(r, 2, n);
			if (r == n - 1)flag = true;
		}
		if (!flag)return false;
	}
	return true;
}

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

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



int main(){
	int e;
	
	cin >> e;
	while(e != 0){
		int minimum = 10000000;
		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) && e - y * y - z * z * z >= 0){
					minimum = min(minimum, e - y * y - z * z * z + y + z);
				}
			}
		}
		cout << minimum << endl;
		cin >> e;
	}

	return 0;
}

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

int main() {
    int e;
    while (true) {
        scanf("%d", &e); if (e == 0) break;
        int vmin = -1;
        for (int yi = 0; yi <= sqrt(e); ++yi) {
            for (int zi = 0; zi <= pow(e, 1.0/3.0); ++zi) {
                int xi = e - yi*yi - zi*zi*zi;
                if (xi < 0) continue;
                if (xi + yi*yi + zi*zi*zi == e) {
                    if (vmin == -1) vmin = xi+yi+zi;
                    else vmin = min(vmin, xi+yi+zi);
                }
            }
        }
        cout << vmin << endl;
    }
}