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 () {
  long long int e;
  cin >> e;
  long long int min = 0;
  for (long long int i = 0; i < e+1; i++) {
    for (long long int k = 0; k < e+1; k++) {
      for (long long int l = 0; l < e+1; l++) {
        if (i + k*k + l*l*l == e) {
          if (min == 0) {
            min = i + k + l;
          } else if (min > i + k + l) {
            min = i + k + l;
          }
        }
      }
    }
  }
  cout << min << endl;
}

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

#define FOR(i, a, b) for(long long int i=(a);i<=(b);i++)
#define RFOR(i, a, b) for(long long int i=(a);i>=(b);i--)
#define MOD 1000000007
#define INF 1000000000 //2000000000
#define LLINF 1000000000000000000 //9000000000000000000
#define PI 3.14159265358979

using namespace std;
typedef long long int ll;
typedef pair< long long int, long long  int> P;



int main(void) {
	
	while (1) {
		int e;
		bool flag = true;
		int mini = INF;

		cin >> e;
		if (e == 0) {
			break;
		}
		RFOR(z, cbrt(e)+1, 0) {
			if (pow(z, 3) > e) {
				continue;
			}
			RFOR(y, sqrt(e-pow(z,3))+1, 0) {
				if (pow(y, 2) < e - pow(z, 3) - pow(y, 2)) {
					break;
				}
				if (pow(y, 2) > e - pow(z, 3)) {
					continue;
				}
				if (pow(y, 2) == e - pow(z, 3)) {
					mini = z + y;
					flag = false;
					break;
				}
				else {
					if (mini > z + y + e - pow(z, 3) - pow(y, 2)) {
						mini = z + y + e - pow(z, 3) - pow(y, 2);
					}
					break;
				}
			}
			if (flag == false) {
				break;
			}
		}
		cout << mini << endl;
	}

}

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

#define FOR(i, a, b) for(long long int i=(a);i<=(b);i++)
#define RFOR(i, a, b) for(long long int i=(a);i>=(b);i--)
#define MOD 1000000007
#define INF 1000000000 //2000000000
#define LLINF 1000000000000000000 //9000000000000000000
#define PI 3.14159265358979

using namespace std;
typedef long long int ll;
typedef pair< long long int, long long  int> P;



int main(void) {
	
	while (1) {
		int e;
		int mini = INF;

		cin >> e;
		if (e == 0) {
			break;
		}
		RFOR(z, sqrt(e), 0) {
			if (pow(z, 3) > e) {
				continue;
			}
			RFOR(y, e-pow(z,3), 0) {
				if (pow(y, 2) > e - pow(z, 3)) {
					continue;
				}
				if (pow(y, 2) == e - pow(z, 3)) {
					mini = z + y;
				}
				else {
					if (mini > z + y + e - pow(z, 3) - pow(y, 2)) {
						mini = z + y + e - pow(z, 3) - pow(y, 2);
					}
				}
			}
		}
		cout << mini << endl;
	}

}

C++: #include <cstdio>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

int main()
{
    for(;;){
        int e;
        cin >> e;
        if(e == 0)
            return 0;

        int ret = INT_MAX;
        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;
                ret = min(ret, x + y + z);
            }
        }
        cout << ret << endl;
    }
}

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

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

typedef long long int integer;

integer solve(integer e) {
  for (integer x = 0; x <= e; x++) {
    for (integer y = 0; x + y*y <= e; y++) {
      for (integer z = 0; x + y*y + z*z*z <= e; z++) {
        if (x + y*y + z*z*z == e) {
          return x + y + z;
        }
      }
    }
  }
}

int main() {
  integer e;
  while (cin >> e and e != 0) {
    cout << solve(e) << endl;
  }
}

C++: #include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>	// require sort next_permutation count __gcd reverse etc.
#include <cstdlib>	// require abs exit atof atoi 
#include <cstdio>		// require scanf printf
#include <functional>
#include <numeric>	// require accumulate
#include <cmath>		// require fabs
#include <climits>
#include <limits>
#include <cfloat>
#include <iomanip>	// require setw
#include <sstream>	// require stringstream 
#include <cstring>	// require memset
#include <cctype>		// require tolower, toupper
#include <fstream>	// require freopen
#include <ctime>		// require srand
#define rep(i,n) for(int i=0;i<(n);i++)
#define ALL(A) A.begin(), A.end()
#define INF 1<<30

using namespace std;

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

int main()
{
//	cut here before submit 
//	freopen ("testcase.SCG", "r", stdin );
	int e;
	while (scanf ("%d", &e ), e ) {
		int m = INF;
		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 >= 0 ){
					m = min (m, x + y + z );
				} // end if
			} // end for
		} // end for
		printf ("%d\n", m );
	} // end loop
		
	return 0;
}

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

using namespace std;

int find(int e)
{
    int m = 1000000;
    for(int z=0; z<=100; z++)
    {
        int r = e - z*z*z;
        if(r<0) break;
        for(int y=0; y<=r; y++)
        {
            int x = r - y*y;
            if(x>=0) m = min(m, x+y+z);
        }
    }
    return m;
}

int main()
{
    int e;
    while(cin >> e, e) cout << find(e) << endl;
}

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

int n;
void init(){
  n=0;
}

int input(){
  cin>>n;
  return n;
}

int solve(){
  for(int m=0;m<=n;m++){
    for(int i=m;i>=0;i--){
      for(int j=m-i;j>=0;j++){
        if(i*i*i+j*j+(m-i-j)==n){
          return m;
        }
      }
    }
  }
}




int main(){
  while(init(),input()){
    cout<<solve()<<endl;
  }
}

C++: #include <stdio.h>
int main(void)
{
  int e,m;
  int i,j,k;
  for(;;)
    {
      scanf("%d",&e);
      m=e+1;
      if(e==0){break;}
      for(i=0;i<=e;i++)
	{
	  /*printf("i=%d",i);*/
	  for(j=0;j<=e;j++)
	    {
	      for(k=0;k<=e;k++)
		{
		 		  if(i+(j*j)+(k*k*k)==e && i+j+k<m)
		    {
		      m=i+j+k;
		     		    }
		}
	    }
	}
      printf("%d\n",m);
    }
  return 0;
}

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

int count = 0; // ?¨???¬??¨ global ?????°
int solve(int E) {
 // ?????´????±???????
	int ans = 1000000 // ?????§???
	for (int x=0; x<=E; ++x)
		for (int y=0; y*y<=E; ++y)
			for (int z=0; z*z*z<=E; ++z) {
				++count;
				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++: #include <iostream>
using namespace std;

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

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

int main() {
  int e;
  while (scanf("%d", &e) != EOF && e) {
    int m = 10000;
    for (int x=0; x<110; x++) {
      for (int y=0; y<110; y++) {
	for (int z=0; z<110; z++) {
	  if (e == x + y*y + z*z*z && x+y+z < m) {
	    m = x + y + z;
	  }
	}      
      }      
    }
    printf("%d\n", m);
  }
}