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++: #ifndef _WIN32
#include<iostream>
#endif // !_WIN32

#include<cmath>
#include<iomanip>
#include<algorithm>
#include<vector>
#include<queue>
#include<stack>
#include<map>
#include<set>
#include<functional>

using namespace std;
#define FOR(i,bg,ed) for(int i=(bg);i<(ed);i++)
#define REP(i,n) FOR(i,0,n)

template<typename T>
bool chmin(T& l, T r) {
	bool res = l > r;
	if (res)l = r;
	return res;
}
int f(int x, int y, int z) {
	return x + y + z;
}
int main() {
	int e;
	while (cin>>e,e) {
		int res = e;
		REP(y, 1001)REP(z, 101) {
			int x = e - y*y - z*z*z;
			if (x >= 0)chmin(res, x + y + z);
		}
		cout << res << endl;
	}
	return 0;
}

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

int main(){
  int e;

  while(cin>>e,e){
    if(e==1) cout << e << endl;
    else{
      int x=e,y=round(pow((double)e,1.0/2.0)),z=round(pow((double)e,1.0/3.0)),m=x;

      for(int i=0;i<x;i++){
        for(int j=0;j<=y;j++){
          for(int k=0;k<=z;k++){
            if(i+round(pow((double)j, 2.0))+round(pow((double)k, 3.0))==e&&m>i+j+k){
              m=i+j+k;
              break;
            }else if(i+round(pow((double)j, 2.0))+round(pow((double)k, 3.0))>e){
              break;
            }
          }
          if(m!=x) break;
        }
        if(m!=x) break;
      }
      cout << m << endl;
    }
  }

  return 0;
}

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

int e = 0;

int solve(){
    int x,y,z;

    int z_max;
    int res = INT_MAX;
    for(y=0; y<=e; ++y){
        z_max = pow(e-y*y, 1.0/3.0) + 1;
        for(z=0;z<=z_max;++z){
            x = e - y*y - z*z*z;
            if(x >= 0){
                res = std::min(res, x+y+z);
            }
        }
    }
    return res;
}

int main(void){
    while(true){
        std::cin >> e;
        if(e == 0) break;
        std::cout << solve() << std::endl;
    }
}

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

#define int             long long
#define FOR( i, m, n )  for( int (i) = (m); (i) < (n); (i)++ )
#define REP( i, n )     FOR( i, 0, n )
#define REPR( i, m )    for( int (i) = (m); (i) >= 0; (i)-- )
#define REPONE( i, n )  FOR( i, 1, n + 1 )
#define ALL( a )        (a).begin(), (a).end()
#define MP              make_pair

using namespace std;
using P = pair<int, int>;

template<class T>bool chmax( T& a, const T& b ) { if( a < b ) { a = b; return 1; } return 0; }
template<class T>bool chmin( T& a, const T& b ) { if( a > b ) { a = b; return 1; } return 0; }

const int INF = 1e9;
const int INFLL = 1e18;
const int MOD = 1e9 + 7;

signed main(){
    int e;
    while( cin >> e, e ){
        int ans = INF;
        for( int y = 0; y * y <= e; y++ ){
            for( int z = 0; z * z * z <= e; z++ ){
                int x = e - y * y - z * z * z;
                if( x >= 0 ) chmin( ans, x + y + z );
            }
        }

        cout << ans << endl;
    }
}

C++: #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <ctime>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <numeric>
#include <list>

using namespace std;

#ifdef _MSC_VER
#define __typeof__ decltype
template <class T> int __builtin_popcount(T n) { return n ? 1 + __builtin_popcount(n & (n - 1)) : 0; }
#endif

#define foreach(it, c) for (__typeof__((c).begin()) it=(c).begin(); it != (c).end(); ++it)
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define popcount __builtin_popcount

#define rep(i, n) for (int i = 0; i < n; ++i)

template <class T> void max_swap(T& a, const T& b) { a = max(a, b); }
template <class T> void min_swap(T& a, const T& b) { a = min(a, b); }

const double EPS = 1e-10;
typedef long long ll;
typedef pair<int, int> pint;


int main()
{
	vector<int> cub, sq;
	for (int i = 0; i*i*i <= 1000000; ++i)
		cub.push_back(i*i*i);
	for (int i = 0; i*i <= 1000000; ++i)
		sq.push_back(i*i);

	int e;
	while (scanf("%d", &e), e)
	{
		int res = e;
		for (int z = 0; cub[z] <= e; ++z)
			for (int y = 0; sq[y] + cub[z] <= e; ++y)
				min_swap(res, (e - (sq[y] + cub[z])) + y + z);
		printf("%d\n", res);
	}
}

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

int main(){
	int n;
	cin >> n;
	while(n != 0){
		int a,b,c;
		a = 1e9;
		b = pow(n,0.34);
		c = pow(n,0.5);
		for(int i = 0; i <= b; i++){
			for(int j = 0; j <= c*2; j++){
				int t =(n-i*i*i-j*j);
				if(t >= 0)a= min( i+j+t, a);
			}
		}
		cout << a<<endl;
		cin >> n;
	}
	return 0;
}

C++: #include <stdio.h>
#include <iostream>
#include <string>
#include <algorithm>
#include <math.h>

using namespace std;

#define MAX_N 128;

int ans;


int main()
{
    int e;
    
    int ans = 100000000;;
    int temp = 10000000;
    
    
    while(cin >> e && e)
    {
        ans = 100000;
        for(int z=0; z<=100; ++z)
        {
            for(int y=0; y<=1000; ++y)
            {
                
                int m = (e - y*y - z*z*z) + y*y + z*z*z;
                if(m == e)
                {
                    int x = e - y*y - z*z*z;
                    if(x >= 0)
                    {
                        if(ans > x+y+z){ans = x+y+z;}
                    }
                }
            }
        }
        cout << ans << endl;
    }
}

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

using namespace std;

int main(void)
{
  int e;
  while(cin >> e, e) {
    int min = e;
    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>
#define MAXN 1000001;
using namespace std;
int m,e,sum1,sum2,x,y,z,minn;
int main(){
	while(1){
		cin >>e;
		if(e==0)break;
		x=y=z=0;
		minn=MAXN;
		while(1){
			sum1=z*z*z;
			if(e<sum1)break;
			y=0;
			while(1){
				sum2=sum1+y*y;
				if(e<sum2)break;
				if(y+z+(e-sum2)<minn)minn=y+z+(e-sum2);
				y++;
			}
			z++;
		}
		cout <<minn<<endl;
	}
}

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


int main() {
    int E,x,y,z,m;
    while (cin >> E && E>0) {
       m = 1000000;
       z = pow(E, 1.0/3.0)/1;
       y = pow(E, 1.0/2.0)/1;
       for (int i = 0 ; i <= z ; i++) {
           for (int j = 0 ; j <= y ; j++){
               x = E - i*i*i - j*j;
               if (x+j+i<=m && x>=0) m = x+j+i;
           }
       }
       cout << m <<endl;
    }
}

C++: #include<iostream>
#include<cmath>
using namespace std;
int x,y,z;
int e;
int solve(){
	int minnum = 1000000;
	for(int z = 0; pow(z, 3) <= e; z++)
	{
		y = (int)sqrt(e - pow(z, 3));
		minnum = min(minnum,(int)(e - pow(z, 3)-pow(y, 2))+y+z); 
	}
	return minnum;
};
int main(){
	int A[100000];
    int k = 0;
	while( cin>>e && e>0 )
	{
		A[k]=solve();
        k++;
	}
	for(int l = 0;l < k; l++)
    {
        cout<<A[l]<<endl;
    }
	return 0;
}