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++: /* 2012-08-20T10:33:30 */
#define DEBUG_ON
#define CONDITION true
using namespace std;/*{{{*/

#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <sys/time.h>
#include <vector>

#define INF (1e9)
static const double PI = acos(-1.0);
static const double EPS = 1e-10;

typedef long long int LL;
typedef unsigned long long int ULL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef complex<double> P;

#define FOR(i, b, e) for (typeof(b) i = (b); i != (e); i < (e)? ++i : --i)
#define REP(i, n) FOR(i, 0, n)

#define IFC(c) if(c) continue;
#define IFB(c) if(c) break;
#define IFR(c, r) if(c) return r;

#define OPOVER(_op, _type) inline bool operator _op (const _type &t) const

#define arrsz(a) ( sizeof(a) / sizeof(a[0]) )

#define F first
#define S second
#define MP(a, b) make_pair(a, b)

#define SZ(a) ((LL)a.size())
#define PB(e) push_back(e)
#define SORT(v) sort((v).begin(), (v).end())
#define RSORT(v) sort((v).rbegin(), (v).rend())

#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define EACH(c,it) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define EXIST(s,e) ((s).find(e)!=(s).end())

#define BIT(n) (1ULL << (n))
#define BITOF(n, m) ((ULL)(n) >> (m) & 1)

#define RANGE(a, b, c) ((a) <= (b) && (b) <= (c))

#ifdef DEBUG_ON
#define dprt(fmt, ...) if (CONDITION) fprintf(stderr, fmt, __VA_ARGS__)
#define darr(a) if (CONDITION) copy( (a), (a) + arrsz(a), ostream_iterator<int>(cerr, " ") ); cerr << endl
#define darr_range(a, f, t) if (CONDITION) copy( (a) + (f), (a) + (t), ostream_iterator<int>(cerr, " ") ); cerr << endl
#define dvec(v) if (CONDITION) copy( ALL(v), ostream_iterator<int>(cerr, " ") ); cerr << endl
#define darr2(a, n, m) if (CONDITION) FOR(i, 0, (n)){ darr_range( (a)[i], 0, (m) ); }
#define dvec2(v) if (CONDITION) FOR(i, 0, SZ(v)){ dvec( (v)[i] ); }
#define WAIT() if (CONDITION) { string _wait_; cerr << "(hit return to continue)" << endl; getline(cin, _wait_); }
#define dump(x) if (CONDITION) cerr << " [L" << __LINE__ << "] " << #x << " = " << (x) << endl;
#define dumpf() if (CONDITION) cerr << __PRETTY_FUNCTION__ << endl;
#define dumpv(x) if (CONDITION) cerr << " [L:" << __LINE__ << "] " << #x << " = "; REP(q, (x).size()) cerr << (x)[q] << " "; cerr << endl;
#define where() if (CONDITION) cerr << __FILE__ << ": " << __PRETTY_FUNCTION__ << " [L: " << __LINE__ << "]" << endl;
#define show_bits(b, s) if(CONDITION) { REP(i, s) { cerr << BITOF(b, s-1-i); if(i%4 == 3) cerr << ' '; } cerr << endl; }
#else
#define cerr if(0) cerr
#define dprt(fmt, ...)
#define darr(a)
#define darr_range(a, f, t)
#define dvec(v)
#define darr2(a, n, m)
#define dvec2(v)
#define WAIT()
#define dump(x)
#define dumpf()
#define dumpv(x)
#define where()
#define show_bits(b, s)
#endif

inline int bits_count(ULL b) { int c = 0; while(b != 0) { c += (b & 1); b >>= 1; } return c; }
inline int toInt(string s) { int v; istringstream sin(s);sin>>v;return v; }
template<class T> inline string toString(T x) { ostringstream sout;sout<<x;return sout.str(); }
inline double now(){ struct timeval tv; gettimeofday(&tv, NULL); return (static_cast<double>(tv.tv_sec) + static_cast<double>(tv.tv_usec) * 1e-6); }
inline VS split(string s, char delimiter) { VS v; string t; REP(i, s.length()) { IFC(s[i] == ' '); if(s[i] == delimiter) v.PB(t), t = ""; else t += s[i]; } v.PB(t); return v; }

template<typename T1, typename T2> ostream& operator<<(ostream& s, const pair<T1, T2>& d) {return s << "(" << d.first << ", " << d.second << ")";}
/*}}}*/

int main() {
	ULL e;
	while(cin >> e, e) {
		int ans = INF;

		FOR (i, 0, (int)cbrt(e) + 1) {
			FOR (j, 0, (int)sqrt(e) + 1) {
				int k = e - pow(i, 3) - pow(j, 2);
				if (k >= 0) {
					ans = min(ans, i + j + k);
				}
			}
		}

		cout << ans << endl;
	}
}

C++: #include <iostream>
#include <math.h>
#include <vector>

using namespace std;

int e[10010], m[10010];

int solve2(int E){
  int minimum = 1000000;
  for(int z = 0; z <= 100; ++z) //zとyからxを算出
    for(int y = 0; y <= 1000; ++y){
      int x = E - y*y - z*z*z;
      if(x >= 0)
        minimum = min(minimum, x + y + z);
    }
  return minimum;
}

int solve(int E)
{
  int minimum = 1000000;
  if (E == 1)
  {
    minimum = 1;
  }
  else
  {
    for (int x = 0; x <= E; ++x)
    {
      for (int y = 0; y <= E; ++y)
      {

        //y = y_solver(x, z, E);
        //int z = z_solver(x, y, E);
        if (int z = (int)round(pow(E - x - y * y, 1.0 / 3)))
        {
          if (int y1 = (int)round(pow(E - x - pow(z, 3), 1.0 / 2)))
          {
            //int x1 = (int)round(E - pow(z, 3) - y1 * y1);
            if (x + y1 * y1 + pow(z, 3) == E)
            {

              if (x + y1 + z < minimum)
              {
                minimum = x + y1 + z;
              }
            }
          }
        }
      }
      //for (int z = 0; z <= E; ++z)
      //{
      //int y = (int)round(pow(E - x - pow(z, 3), 1.0 / 2));
      //}

      //if (x + y * y + pow(z1, 3) == E)
      //{

      //}
    }
  }
  return minimum;
}

int main()
{
  int E;
  while(cin >> E && E > 0){
    cout << solve2(E) << endl;
  }
  //for (int i = 0; i < 1000000; ++i)
  //{
    //cin >> e[i];
    //if (e[i] != 0)
    //{
    //  cout << solve(e[i]) << endl;
    //}
    //else
    //{
    //  break;
    //}
  //}
}

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

using namespace std;
int main() {
	int e;
	while(cin >> e && e > 0){
		int min_sum = 100000;
		for(int i = 0; i <= e; i++)
		{
			int j = sqrt(e - i*i*i);
			int k = e - i*i*i - j*j;
			int temp;
			temp = i + j + k;
			min_sum = min(temp, min_sum);
		}
		cout << min_sum << endl; 
	}
	
}

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)
            {
                for(int x=0; x<1000; ++x)
                {
                    
                    int m = x + pow(y, 2) + pow(z, 3);
                    if(m == e)
                    {
                        temp = x+y+z;
                        if(ans > temp){ans = temp;}
                    }
                    
                }
            }
            }
        cout << ans << endl;
    }
}

C++: #include <bits/stdc++.h>
using namespace std;
int main(void){
int e;
long long minm;
int mi=0,mj=0,mk=0;
vector<vector<vector<int> > >nums(345,vector<vector<int> >(174,vector<int>(101)));
for(int i=0;i<345;i++){
	for(int j=0;j<174;j++){
		for(int k=0;k<101;k++){
			nums[i][j][k]=(i+j*j+k*k*k);
			if(nums[i][j][k]<1000000){mi=max(mi,i);mj=max(mj,j);mk=max(mk,k);}
		}
	}
}
while(true){
cin>>e;
if(e==0)break;
minm=LLONG_MAX;
for(int i=0;i<mi;i++){
	for(int j=0;j<mj;j++){
		for(int k=0;k<mk;k++){
			if(e==nums[i][j][k])minm=min(minm,(long long)i+j+k);
		}
	}
}
cout<<minm<<endl;
}
return 0;
}