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<algorithm>
using namespace std;
int main() {
	int n;
	while (cin >> n, n) {
		int ans = 1145141919;
		for (int y = 0; y <= 1000; y++) {
			for (int z = 0; z <= 100; z++) {
				if (n < y*y + z*z*z)continue;
				ans = min(ans, n - y*y - z*z*z + y + z);
			}
		}
		cout << ans << endl;
	}return 0;
}

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

//repetition
#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)

//container util
#define all(x) (x).begin(),(x).end()

//typedef
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VLL;
typedef vector<VLL> VVLL;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;

//const value
//const ll MOD = 1e9 + 7;
//const int dx[] = {0,1,0,-1};//{0,0,1,1,1,-1,-1,-1};
//const int dy[] = {1,0,-1,0};//{1,-1,0,1,-1,0,1,-1};

//conversion
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
inline ll toLL(string s) {ll v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}


int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll e;
  ll x = 0;
  VLL three;
  map <ll,ll>tIdx;
  while(x*x*x <= 1000000){
    three.push_back(x*x*x);
    tIdx[x*x*x] = x;
    x++;
  }
  x = 0;
  VLL second;
  map <ll,ll>sIdx;
  while(x*x <= 1000000){
    second.push_back(x*x);
    sIdx[x*x] = x;
    x++;
  }
  while(true){
    cin >> e;
    if(e== 0) break;
    ll ans = 1e9;
    for(ll xx:three){
      for(ll yy:second){
        ll zz = e-xx-yy;
        if(zz < 0) continue;
        else ans = min(ans,sIdx[yy]+tIdx[xx]+zz);
      }
    }
    cout << ans << endl;
  }
  return 0;
}

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=0;i<=m;i++){
      for(int j=0;j<=m-i;j++){
        if(i*i*i+j*j+(m-i-j)==n){
          return m;
        }
      }
    }
  }
}




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

C++: #include <iostream>
#include <queue>
#include <cctype>
#include <stdio.h>
#include <map>
#include <math.h>


using namespace std;

int main(int argc, char const* argv[])
{
    int e;
    while (cin >> e, e) 
    {
        int x,y,z;
        int m = 1000000;

        //for (int i = 0; i <= e; i++) 
        //{
        //    for (int j = 0; j*j <= e; j++) 
        //    {
        //        for (int k = 0; k*k*k <= e; k++) 
        //        {
        //            //cout << " x y z = " << i << j << k <<endl;
        //            if ( i + j*j + k*k*k == e) 
        //            {
        //                m = min( m, i + j + k);
        //            }
        //        }
        //    }
        //}
        for (int k = 0; 0 <= k*k*k; k++) 
        {
            int j = sqrt(e - k*k*k);
            int i = e - k*k*k -j*j;
            m = min( m, i + j + k);
        }
        cout << m << endl;
    }
    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 calc2(){
  int ans = 5000000;
  REP(z, 100){
    int y = (int)(floor(sqrt(E - z))), x = E - y - z;
    if(y >= 0 && x >= 0){
      cout <<x <<", " <<y <<", " <<z <<", " <<x + y + z <<endl;
      ans = min(ans, x + y + z);
    }
  }
  return ans;
}

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

int main() {
  while(cin >>E && E) cout <<calc() <<endl;
  //while(cin >>E && E) cout <<calc2() <<endl;
  return 0;
}

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

const int INF = 99999999;

int main(void) {

  int e, t;
  vector<int> y2, z3;
  for (t = 0; t*t <= 1000000; t++) y2.push_back(t*t);
  for (t = 0; t*t*t <= 1000000; t++) z3.push_back(t*t*t);

  while (scanf("%d", &e), e) {
    int m = INF;
    for (int i = 0; i < y2.size(); i++) {
      for (int j = 0; j < z3.size(); j++) {
        if (y2[i]+z3[j] <= e) {
          m = min(m, (e-y2[i]-z3[j])+i+j);
        }
      }
    }
    printf("%d\n", m);
  }

  return 0;
}

C++: #include <iostream>

using namespace std;

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

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

int main() {

  long long int e;

  while( true ) {

    cin >> e;

    if ( e == 0 ) break;

    long long int ans = 10000000;

    for ( long long int z = 0; z * z * z <= e; z++ ) {

      long long int e2 = e - z * z * z;

      for ( long long int y = 0; y * y <= e2; y++ ) {

	ans = min( ans, e2 - y * y + y + z );

      }

    }

    cout << ans << endl;

  }

  return 0;

}

C++: #include <bits/stdc++.h>
#define int long long
using namespace std;
main(){
  int e;
  while(cin>>e,e){
    int ans=1e9;
    for(int z=0;;z++){
      if(z*z*z>e)break;
      for(int y=0;;y++){
        if(z*z*z+y*y>e)break;
        int a=e-z*z*z+y*y;
        ans=min(ans,x+y+z);
      }
    }
    cout<<ans<<endl;
  }
}

C++: #include <iostream>
using namespace std;
int main(){
  int x,E;
  while(cin >> E && E > 0){
    int xyz = 1000000;
    for(int z=100;z>=0;z--){
      for(int y=1000;y>=0;y--){
        x = E - y*y - z*z*z;
        if((x>=0) && (x+y+z < xyz)){
          xyz = x+y+z;
        }//
      }//fory
    }//forz
    cout << xyz << endl;
  }//whileE>0
}

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

using namespace std;

int Energy;

int main()
{
        while(cin >> Energy) {
                if (Energy == 0) {
                        break;
                }

                int temp_min;
                int min = -1;

                for (int i = 0; i * i * i <= Energy; ++i) {
                        for (int j = 0; j * j <= Energy - i * i * i; ++j) {
                                temp_min = i + j + Energy - i * i * i - j * j;
                                if(min < 0) min = temp_min;
                                else if(min > temp_min) min = temp_min;
                        }
                }

                cout << min << endl;
        }
        return 0;
}