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

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

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

int main()
{
	int e;
	while (cin >> e,e)
	{
		bool f=1;
		for (int x=0; f&&x<=e; x++)
		for (int y=0; f&&y*y<=e; y++)
		for (int z=0; f&&z*z*z<=e; z++)
		{
			int a = x+y*y+z*z*z;
			if (a > e) break;
			if (a == e)
			{
				cout << x+y+z << endl;
				f=0; break;
			}
		}
	}
}

C++: #include<algorithm>
#include<cstdio>
#include<cmath>
#define repi(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,a) repi(i,0,a)

int e;

int main()
{
  while( scanf( "%d", &e ), e )
  {
    int ans = 1000000;
    
    rep( y, sqrt(e)+1 ) rep( z, cbrt(e)+1 ) if( y*y+z*z*z <= e )
      ans = std::min( ans, (e-y*y-z*z*z)+y+z );

    printf( "%d\n", ans );
  }

  return 0;
}

C++: #include<iostream>
#include<string>
main(){int e;while(std::cin>>e&&e){int m=1<<30;for(int z=0,c=0;c<=e;++z,c=z*z*z)for(int y=0,b=0;c+b<=e;++y,b=y*y)m=std::min(m,e-c-b+y+z);std::cout<<m<<'\n';}}

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 = floor(pow(E, 1.0/3.0));
       y = floor(pow(E, 1.0/2.0));
       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 count = 0; // count the number of iterations
int solve(int E) {
  int ans = E;
  for (int y = 0; y*y <= E; ++y)
    for (int z = 0; z*z*z <= E; ++z){
      ++count; // Minimum number of counts when the looping is minimized; loop y and z thus.
      int x = (int) round(E-y*y-z*z*z);
      
      if (x + y*y + z*z*z == E)
	ans = min(ans, x + y + z);
    }
return ans;
}
int main() {
  int E;
  while (cin >> E && E>0) {
    cout << solve(E) << endl;
  }
}

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

#define rep(i,n) for(int i = 0; i < n; i++)
#define rrep(i,n) for(int i = n - 1; i >= 0; i--)
#define REP(i,k,n) for(int i = k; i < n; i++)

#define vi vector<int>
#define pb push_back
using namespace std;

int main(){
    int e;
    while(cin >> e,e) {
        int m = 1000000;
        for(int z = 0; pow(z,3) <= e; z++) for(int y = 0; pow(y,2) <= e - pow(z,3); y++) {
                int x = e - pow(y,2) - pow(z,3);
                if(x >= 0) {
                    m = min(m,x + y + z);
                }
            }
        cout << m << endl;
    }

    return 0;

}

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

using namespace std;
typedef long long ll;

int main () {
  int e;
  while(scanf("%d", &e), e!=0) {
    int mn = e;
    for (int y=0; y<=e; y++) {
      for (int z=0; z<=e; z++) {
        auto x = e - pow(z, 3) - pow(y, 2);
        // printf("x: %f\n", x);
        if (x>=0 && floor(x) == ceil(x)) {
          mn = min(mn, int(x) + y + z);
          // printf("x: %f y: %d z: %d mn: %d\n", x, y, z, mn);
        }
      }
    }
    printf("%d\n", mn);
  }
  return 0;
}

C++: #include <iostream>
using namespace std;
int main() {
  int ene;
  for (int i=0; cin >> ene && ene>0; i++){
    int min = 1000000;
    int z=0;
    while (z<=100) {
      int y=0;
      while (y<=10000) {
	int x = ene-z^3-y^2;
	if (x+y+z<min) min = x+y+z;
      }
    }
    cout << min << endl;
  }
}

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) && 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 <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 = 10000;;
    int temp = 10000;
    
    
    while(cin >> e && e)
    {
        ans = 100000;
        for(int z=0; z<=100; ++z)
        {
            for(int y=0; y<=100; ++y)
            {

                    int m = (e-pow(y,2)-pow(z,3)) + pow(y, 2) + pow(z, 3);
                    if(m == e)
                    {
                        int x = e-pow(y,2)-pow(z,3);
                        if(x < 0){break;}
                        temp = x+y+z;
                        if(ans > temp){ans = temp;}
                    }
            }
        }
        cout << ans << endl;
    }
}

C++: #include "stdafx.h"
#include <iostream>
#include <cmath>
using namespace std;

#define E 1000000

int main()
{
	int e;

	while (cin >> e && e > 0) {
		int min = E + 1;
		int e_i, e_j;
		e_i = 1000;
		e_j = 100;
		for (int i = 0; i < e_i; i++) {
			for (int j = 0; j < e_j; j++) {
				if (i*i + j*j*j > e)
					break;
				int s;
				s = (e - i*i - j*j*j) + i + j;
				
				if (s < min)
					min = s;
			}
		}

		cout << min << endl;

	}



    return 0;
}

C++: #include<stdio.h>
#include<math.h>
int main(){


int E;
while(1){
scanf("%d",&E);if(E==0)break;
int min=E;int m=E;
for(int i=0;i<=E;i++)
for(int j=0;j<=sqrt((double)E);j++)
for(int k=0;k<=sqrt((double)E);k++)
{if(i+j*j+k*k*k>E)break;
if(i+j*j+k*k*k==E&&i+j+k<=min)min=i+j+k;
}
printf("%d\n",min);
}
return 0;
}

C++: #include "bits/stdc++.h"

using namespace std;

const int INF = numeric_limits<int>::max() / 2;

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

    int e;
    while (cin >> e, e)
    {
        int res = 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)
                    continue;
                res = min(res, x + y + z);
            }
        }
        cout << res << endl;
    }
}

C++: #include<bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vs = vector<string>;
using msi = map<string, int>;
using mii = map<int, int>;
using psi = pair<string, int>;
using pii = pair<int, int>;
using vlai = valarray<int>;
#define rep(i,n) for(int i=0;i<n;i++)
#define range(i,s,n) for(int i=s;i<n;i++)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define fs first
#define sc second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define INF 1E9
#define EPS 1E-9
#define MOD (ll)(1E9+7)
#define PI 3.1415926535897932384

template <class T>ostream &operator<<(std::ostream &o, const vector<T> &v)
{
	rep(i, v.size()) {
		o << (i > 0 ? " " : "") << v[i];
	}
	return o;
}



int main() {
	int e,n=1000000;
	while (1) {
		cin >> e;
		int mi = INF;
		if (e == 0) break;
		for (int i = 0; i <= e; i++) {
			for (int j = 0; j*j <= (e-i*i*i); j++) {
				if (j*j + i*i*i > e) break;
				int x = e - (j*j + i*i*i);
				if (mi > (i + j + x)) {
					mi = i + j + x;
				}
			}
		}
		cout << mi << endl;
	}
}