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 <cstdlib>
#include <cmath>

using namespace std;

struct Ans{
  int x;
  int y;
  int z;
};
static const int E_MAX = 1000001;
static const int Y_MAX = 1000;
static const int Z_MAX = 100;
Ans ans[ E_MAX ];

int main (){
  for( int i = 0; i < E_MAX; i++ ) {
    ans[ i ].x = -1;
  }

  for( int y = 0; y <= Y_MAX; y++ ) {
    for( int z = 0; z <= Z_MAX; z++ ) {
      int idx = y * y + z * z * z;
      if( idx >= E_MAX ){ break; }
      if( ans[ idx ].x != -1 ) {
        if(
            y + z < ans[ idx ].y + ans[ idx ].z
        ) {
          ans[ idx ].y = y;
          ans[ idx ].z = z;
        }
        continue;
      }
      ans[ idx ].x = 0;
      ans[ idx ].y = y;
      ans[ idx ].z = z;
    }
  }

  int counter = 0;
  int py = -1, pz = -1;
  for( int i = 0; i < E_MAX; i++ ) {
    if( ans[ i ].x != -1 ) {
      if(
          counter + py + pz < ans[ i ].y  + ans[ i ].z &&
          py != -1 && pz != -1
       ){
        ans[ i ].x = ++counter;
        ans[ i ].y = py;
        ans[ i ].z = pz;
      }else{
        counter = 0;
        py = ans[ i ].y;
        pz = ans[ i ].z;
      }
      continue;
    }
    ans[ i ].x = ++counter;
    ans[ i ].y = py;
    ans[ i ].z = pz;
  }
  while( 1 ) {
    int e;
    cin >> e;
    if( !e ){ return EXIT_SUCCESS; }
    cout << ans[ e ].x + ans[ e ].y + ans[ e ].z << endl;
  }
}

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

int main(int argc, char *argv[])
{
    int x, y, z, e, m;
    while (cin >> e, e) {
        m = 1000000;
        for (int z = 0; z <= 100; ++z) {
            if (z*z*z > e)
                break;
            for (int y = 0; y <= sqrt(e - z*z*z); ++y) {
                for (int x = 0; x <= e - (y*y + z*z*z); ++x) {
                    if (x + y*y + z*z*z == e)
                        m = min(m, x + y + z);
                }
            }
        }
        cout << m << endl;
    }
    return 0;
}

C++: #if 0
    感想
#endif

#include <iostream>
#include <cmath>
using namespace std;
unsigned int e;

int calcMinimumSum() {
    int sum = 1000000;
    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);
            int temp = x + y + z;
            sum = sum < temp ? sum : temp;
        }
    }
    return sum;
}

int main () {
    while(cin >> e && e > 0) {
        cout << calcMinimumSum() << endl;
    }
}

C++: //include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

//debug
#define DUMP(x)  cerr << #x << " = " << (x) << endl;
#define DEBUG(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

const int MILLION = 1000000;
int main(){
    int result=1000000;
    int input;
    bool flag=true;
    while(cin >> input && input){
	for(int i=0; i*i*i<input; i++){
	    for(int j=0; j*j<input-i*i*i; j++){
//		    if(i*i*i+j*j+k==input)
		int k = input - i*i*i - j*j;
		int temp = i+j+k;
		result = min(result, temp);

		}
	    }
	cout << result << endl;
	result = 1000000;
    }
    return 0;
}

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

int main()
{
	int e;
	while (std::cin >> e, e > 0) {
		int m = e;	// ツ可シツづ個値
		const int z_max = static_cast<int>(pow(static_cast<double>(e), 1. / 3.)) + 1;
		for (int z = 0; z <= z_max; ++z) {
			const int y_max = static_cast<int>(sqrt(static_cast<double>(e))) + 1;
			for (int y = 0; y < y_max; ++y) {
				const int x = e - y * y - z * z * z;
				if (x < 0) { break; }
				const int m_ = x + y + z;
				if (m_ < m) { m = m_; }
			}
		}
		std::cout << m << std::endl;
	}
	return 0;
}

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

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);
                    }
                }
            }
        }
        cout << m << endl;
    }
    return 0;
}

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

int main() {

  int m;
  while(cin >> m, m) {
    int ret = 1000111000;

    for(int z=0; z*z*z<=m; z++) {
      int y = sqrt(m-z*z*z);
      int x = m - (z*z*z + y*y);
      ret = min(ret, x+y+z);
    }

    cout << ret << endl;
  }

  return 0;
}

C++: #include <iostream>
#include <string>
#include <map>
#include <math.h>
#include <complex>

using namespace std;

int main(){

    int e;

    while(cin>>e,e){

        int x,y,z;
        int answer = 1000000;
        /*for(int i=0;i<=e;i++){
            for(int j=0;j<=sqrt(e)-i;j++){
                for(int k=0;k<=pow(e,1.0/3.0)-i+pow(j,2.0);k++){
                    if(i+pow(j,2.0)+pow(k,3.0)==e&&answer>i+j+k){
                        answer = i+j+k;
                    }
                }
            }
        }*/

        for(int k=0;k*k*k<=e;k++){
            for(int j=0;j*j<=e-k*k*k;j++){
                int i=e-j*j-k*k*k;
                    if(answer>i+j+k){
                        answer = i+j+k;
                    }
            }
        }

        cout<<answer<<endl;
    }

    return 0;
}

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 && x > 0)
	ans = min(ans, x + y + z);
    }
return ans;
}
int main() {
  int E;
  while (cin >> E && E>0) {
    cout << solve(E) << 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)
            {
                int x = e-pow(y,2)-pow(z,3);
                if(x < 0){break;}

                    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;
    }
}