Go: package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
	"strings"
)

var sc = bufio.NewScanner(os.Stdin)

//Sliceconvtof ...
func Sliceconvtof() []float64 {
	strs := strings.Split(sc.Text(), " ")

	var flts []float64
	var x int

	for _, s := range strs {
		x, _ = strconv.Atoi(s)
		xf := float64(x)
		flts = append(flts, xf)
	}

	return flts
}

//ThirdRoot .
func ThirdRoot(f float64) float64 {
	xn := f / 2
	var dmt float64

	for {
		dmt = math.Pow(xn, 3) - f
		if math.Abs(dmt) < 0.00001*f {
			break
		}

		xn = xn - (dmt / (3 * math.Pow(xn, 2)))
	}

	return xn
}

func main() {

	for sc.Scan() {
		i := Sliceconvtof()
		if i[0] == -1.0 {
			break
		}
		fmt.Printf("%6f\n", ThirdRoot(i[0]))
	}

}

C++: #include <iostream>
#include <cstdio>
#include <cmath>
#define EQ(a,b) (abs(a - b) < 0.000000001)
using namespace std;

const double INF = (1 << 31) - 1;

int main ()
{
    double q;
    while (cin >> q, q >= 0) {
        double ub = INF, lb = -1;
        while (!EQ(ub,lb)) {
            double mid  = (ub + lb) / 2.0;
            if (mid * mid * mid > q) {
                ub = mid;
            } else {
                lb = mid;
            }
        }
        printf("%.6f\n", lb);
    }

    return 0;
}

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

int main(){
	int q;
	while(cin>>q&&q!=-1){
		double x=q/2.0;
		while(fabs(x*x*x-q)>=0.00001*q)x-=(x*x*x-q)/(3*x*x);
		printf("%.6f\n", x);
	} 
	return 0;
}

C++: #include <iostream>
#include <cmath>
using namespace std;
#define EPS 1e-5

//0080
int main(){
	// x^3=qを漸化式でとく
	// X(n+1) = X(n)-( X(n)^3 - q )/( 3*(X(n)^2) )

	int q;
	while(cin >> q, q!=-1){
		double x = (double)q/2.0;
		while(fabs(x*x*x-q) >= q*EPS){
			x = x - (x*x*x-q)/(3*x*x);
		}

		cout.setf(ios::fixed);
		cout.precision(6);
		cout << x << endl;
	}
	return 0;
}

C++: #include <bits/stdc++.h>
#define PB push_back
#define MP make_pair
#define REP(i,n) for (int i=0;i<(n);i++)
#define ALL(a) (a).begin(),(a).end()
#define INF 1000000001
#define MOD 10000
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
const ull B=100000007;
double rec(double x,double q){
      return x-((x*x*x-q)/(3.0*x*x));
}
int main(){
      double q;
      while(cin>>q&&q!=-1){
            double x=(q/2.0,q);
            REP(i,1000){
                  x=rec(x,q);
            }
            printf("%.10f\n",x);
      }
}

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

#define FOR(i,l,r) for(int i = (int) (l);i < (int) (r);i++)
template<typename T> bool chmax(T& a,const T& b){ return a < b ? (a = b,true) : false; }
template<typename T> bool chmin(T& a,const T& b){ return b < a ? (a = b,true) : false; }
typedef long long ll;

ll N;

int main()
{
	while(scanf("%lld",&N),N != -1){
		double x = N / 2.0;
		do{
			x = x - (x * x * x - N) / (3 * x * x);
		}while(abs(x * x * x - N) >= 0.00001 * N);
		printf("%.10f\n",x);
	}

	return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>

using namespace std;

int main() {
	double q;
	while (cin >> q && q != -1) {
		double x = q / 2;
		while (fabs(pow(x, 3) - q) >= 0.00001) {
			x = x - ((pow(x, 3) - q) / (3 * pow(x, 2)));
		}
		cout << fixed << setprecision(6) << x << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
using namespace std;
#define all(c) (c).begin(),(c).end()
#define pb push_back
#define mp make_pair
#define ERASE(v,i) (v).erase(remove(all(v),i),(v).end())
#define rep(i,n) for(int i=0;i<(int)n;++i)
#define each(it,c) for(typeof((c).begin()) it=(c).begin();it!=(c).end();++it)
#define debug(x) cerr<<#x<<" = "<<(x)<<endl;
#define LINE cerr<<"LINE: "<<__LINE__<<endl;
inline int toInt(string s){int v;istringstream i(s);i>>v;return v;}
template<class T> inline string toString(T x){ostringstream o;o<<x;return o.str();}
template<class T> void pv(T a,T b){for(T it=a;it!=b;++it)cerr<<*it<<" ";cerr<<endl;}
const int INF = 1000000000;
const double EPS = 1e-10;

double func(const double x, const double q) {
	return x - (x * x * x - q) / (3 * x * x);
}

const double epsilon = 0.00001;

int main() {
	for(int N; cin >> N, N != -1;) {
		double x = N / 2.0;
		while(abs(x * x * x - N) >= epsilon * N) {
			// debug(x);
			x = func(x, N);
		}
		cout << x << endl;
	}
}

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

using namespace std;

double make(double in){
  int i = (int)in;
  int k = 0;
  while(i){
    k++;
    i/=10;
  }
  for(int i = 0; i < 5+k; i++) in/=10;
  return 0.00001+in;
}

int main(){

  double in;
  while(cin >> in){
    if(in == -1) break;
    double x = in/2;
    double judge = make(in);
    while(1){
      if(fabs(x*x*x - in) < judge){
	printf("%.6f\n",x);
	break;
      }
      x = (2*x/3 +in/(3*x*x));
    }
  }
  return 0;
}

C++: #include <iostream>
#include <cmath>
#include <cstdio>
//#include <fstream>

using namespace std;

int main()
{
//	cut here before submit 
//	freopen ("testcase.tr", "r", stdin );

	double q;

	while (cin >> q &&  q != -1.0 ){
		double x = q/2.;
		while (fabs (x*x*x - q) >= 0.00001*q  ){
			double y = (x*x*x - q )/(3.*x*x );
			x = x - y;
		} // end while
		printf ("%.6f\n", x );
	} // end loop
		
	return 0;
}

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

int main() {
	double a;
	while (scanf("%lf", &a), a + 1) {
		double b = a / 2;
		for (int c = 0; c < 100; c++) {
			if (abs(b*b*b - a) < a / 100000)break;
			double d = b*b*b - a, e = b*b * 3;
			b -= d / e;
		}
		printf("%.10lf\n", b);
	}
}

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

using namespace std;

double third_root(double xn, double q){
    if((xn*xn*xn-q)>-0.00001  &&  (xn*xn*xn-q)<0.00001){
        return xn;
    }
    
    xn = xn-((xn*xn*xn-q))/(3*xn*xn);
    return third_root(xn, q);
    
}


int main(void)
{
    long long int q;
    while(cin>>q){
        if(q==-1)break;
        cout<<setprecision(7)<<third_root((double)q/2.0, (double)q)<<endl;;
    }
}

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

int main() {
    int q;
    while (cin >> q) {
        if (q == -1) break;
        double x = q / 2.0;
        while (true) {
            x = x - (x*x*x - q) / (3*x*x);
            if (abs(x*x*x-q) < 1e-5*q) break;
        }
        cout.precision(6);
        cout << fixed << x << endl;
    }
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
double temp(double,double);

double temp(double x,double q){
    x-=(x*x*x-q)/(3*x*x);
    return x;
}

int main(){
    double x[50],q;
    int i;
    for(i=0;i<50;i++){
        cin>>q;
        if(q==-1)break;
        x[i]=q/2;
        do{
            x[i]=temp(x[i],q);
        }while(abs(x[i]*x[i]*x[i]-q)>=1e-5*q);
    }
    for(int j=0;j<i;j++){
        cout<<x[j]<<endl;
    }
}

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

int main(){
	double x, q, y;
	while(scanf("%lf", &q), q >= 0.0){
		x = 0.5 * q;
		while(1){
			y = x * x * x - q;
			if(abs(y) < 1e-5 * q){
				break;
			}
			x -= y / (3.0 * x * x);
		}
		printf("%f\n", x);
	}
}

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

int main() {
	int n;
	double res;
	while (cin >> n) {
		if (n == -1) break;
		res = n / 2.0;

		while (1) {
			res = res - ((res*res*res - n) / (3 * res*res));
			if (fabs(res*res*res - n) < 0.00001 * n) break;
		}
		cout << res << endl;
	}
	return 0;
}