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>

using namespace std;

const int INF=1000003;

int main(){
	
	int e;
	while(cin>>e){
		int ans=INF;
		for(int i=0;i*i*i<=e;i++){
			int tmp=e-i*i*i;
			int c;
			for(int j=0;j*j<=tmp;j++)c=j;
			ans=min(ans,i+tmp-c*c+c);
		}
	cout<<ans<<endl;
	}
}

C++: #include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "iomanip"
#include "random"

using namespace std;

const long long int MOD = 1000000007;
const long double EPS = 0.00000001;
const long double PI = 3.1415926535897932384626433;

long long int N, M, K, H, W, L, R;


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

	cin >> N;
	while (N) {
		M = INT_MAX;
		for (int i = 0; i < 100; i++) {
			for (int j = 0; j < 1000; j++) {
				if (N - i*i*i - j*j >= 0) {
					M = min(M, i + j + N - i*i*i - j*j);
				}
			}
		}
		cout << M << endl;
		cin >> N;
	}
	return 0;
}

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

using std::cin;
using std::cout;
using std::endl;

int limit(int lim, int exp) {
	int res = 0;
	if (exp > 1) {
		for (int i = 2; pow(i,exp) < lim+1; i++) {
			res = i;
		}
	}
	else {
		for (int i = 0; pow(i,exp) < lim+1; i++) {
			res = i;
		}
	}
	return res;
}

int main(void) {
	int e;
	cin >> e;

	while (e != 0) {
		int m = 0;
		int res;
		int en = e;
		int temp;

		for (int i = 0; i < 15; i++) {
			m = 0;
			en = e;

			temp = limit(en,3);
			m += temp-i;
			en -= pow(temp-i,3);

			temp = limit(en,2);
			m += temp;
			en -= pow(temp,2);

			temp = limit(en,1);
			m += temp;

			if (i == 0) {
				res = m;
			}
			else if (m < res) {
				res = m;
			}
		}
		
		cout << res << endl;
		cin >> e;
	}
	return 0;
}

C++: #include <iostream>
#include <complex>
#include <sstream>
#include <string>
#include <algorithm>
#include <deque>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <vector>
#include <set>
#include <limits>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <ctime>
using namespace std;
#define REP(i, j) for(int i = 0; i < (int)(j); ++i)
#define FOR(i, j, k) for(int i = (int)(j); i < (int)(k); ++i)
#define P pair<int, int>
#define SORT(v) sort((v).begin(), (v).end())
#define REVERSE(v) reverse((v).begin(), (v).end())

int E;

int calc(){
  int ans = 5000000;
  REP(y, 1000){
    REP(z, 100){
      int tmp = ((int)(pow(z, 3)) + (int)(pow(y, 2)));
      if(tmp > E) break;
      int x = E - tmp;
      ans = min(ans, x + y + z);
    }
  }
  return ans;
}

int main() {
  while(cin >>E && E) cout <<calc() <<endl;
  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<=100; z++){
      if(z < m){
      for(int y=0; y<= sqrt(E-pow(z,3));y++){
	int x = E - pow(z,3) - pow(y,2);
	if (x >= 0){
	  int n = x+y+z;
	  if(n < m){
	    m = n;
	  }
	}
      }
      } 
    }
    cout << m << endl;
  }
}

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

int main()
{
	int energy;

	while (std::cin >> energy, energy)
	{
		int sol = 1e+9;

		for (int z = 0; z * z * z < energy; z++)
		{
			for (int y = 0, yMax = energy - z * z * z; y * y < yMax; y++)
			{
				sol = std::min(sol, z + y + (energy - z * z * z - y * y));
			}
		}

		std::cout << sol << std::endl;
	}

	return(0);
}

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

using namespace std;

#define FOR(i,k,n) for(int i = (k); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define INF 114514810
#define ll long long
#define ALL(a) (a).begin(),(a).end()
#define SORT(v) sort(ALL(v))
//#define scanf scanf_s
typedef pair<int, int> P;

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


	return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int e;
main()
{
	while(cin>>e,e)
	{
		int x,y,z,m=e;
		for(z=0;z*z*z<=e;z++)
		{
			for(y=0;y*y+z*z*z<=e;y++)
			{
				for(x=0;x+y*y+z*z*z<=e;x++)
				{
					m=min(m,x+y+z);
				}
			}
		}
		cout<<m<<endl;
	}
}

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

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

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

int main(){
while(1){//start	
	
	int e;
	int ans = 10000000;
	cin >> e;
	
	if(e == 0) break;
	
	int x;
	for(int y = 0; y < 1000; y++){
		for(int z = 0; z < 100; z++){
			//if(y*y + z*z > e)break;
			x = e - y*y - z*z*z;
			//if(x + y*y + z*z*z > e) break;
			if(x >= 0 and x + y*y + z*z*z == e){
				ans = min(ans, x + y + z);
				//cout << "ans = " << ans << endl;
			}
		}
	}
	
	
	cout << ans << endl;
	
}//end	
	return 0;
}

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

int mycount = 0; // ambigous??¨???????????????????????????
int solve(int E) {
 // ?????´????±???????
	int ans = 1000000; // ?????§???
	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;
				++mycount; 
				if (x+y*y+z*z*z == E)
					if (x+y+z<=ans)
						ans = x+y+z;
			}
	return ans;
}
int main() {
	int E;
	while (cin >> E && E>0)
		cout << solve(E) << endl;
}

C++: //
//  main.cpp
//  Exercise
//
//

#include <algorithm>
#include <iostream>
#include <limits>
#include <math.h>
#include <tuple>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include "string.h"
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <set>

using namespace std;

using int_t = long long;

// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=2012

int main() {
    vector<int> es;
    while (true) {
        int e;
        scanf("%d", &e);
        if (e == 0) {
            break;
        }
        es.push_back(e);
    }
    for (auto e : es) {
        int sumMin = numeric_limits<int>::max();
        for (int y = 0; y * y <= e; y++) {
            for (int z = 0; z * z * z <= e - y * y; z++) {
                int x = e - y * y - z * z * z;
                sumMin = min(sumMin, x + y + z);
            }
        }
        printf("%d\n", sumMin);
    }
    return 0;
}

C++: #include<iostream>

using namespace std;

const int INF=10000003;

int main(){
	
	int e;
	while(cin>>e){
		int ans=INF;
		for(int i=0;i*i*i<=e;i++){
			int tmp=e-i*i*i;
			int c;
			for(int j=0;j*j<=tmp;j++)c=j;
			ans=min(ans,i+tmp-c*c+c);
		}
	cout<<ans<<endl;
	}
}

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

using namespace std;

namespace Solver {

    int e;
    inline bool Read() {
        cin >> e;
        return e != 0;
    }

    inline void Work() {
        int m = 1e+8;
        for (int z = 0; z * z * z <= e; z++) {
            int r = e - z * z * z;
            int y = (int)sqrt(r);
            int x = r - y * y;
            m = min(m, x + y + z);
        }

        cout << m << endl;
    }

    inline void Solve() {
        while(Read()) Work();
    }
}

int main() {
    Solver::Solve();
}