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<bits/stdc++.h>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
using namespace std;

int main(){
	double q=0,alt1=0,alt2=0;
	while(1){
		cin>>q;
		if(q==-1)break;
		alt1=q/2.0;
		alt2=alt1-(pow(alt1,3)-q)/(3*pow(alt1,2));
		while(abs(alt2-alt1)>=0.000001*q){
			alt1=alt2;
			alt2=alt1-(pow(alt1,3)-q)/(3*pow(alt1,2));
		}
		printf("%.9f\n",alt2);
	}
	return 0;
}

C++: #include<bits//stdc++.h>
using namespace std;
int main(){
	int a;
	while(cin>>a&&a!=-1){
		double x1=a/2,x2;
		int i=1;
		while(true){  
				x2=x1-(x1*x1*x1-a)/(3*x1*x1);
				if(abs(x2*x2*x2-a)<0.00001*a) 
				{
					cout<<x2<<endl;
					break;
				}
				x1=x2-(x2*x2*x2-a)/(3*x2*x2);
				if(abs(x1*x1*x1-a)<0.00001*a) 
				{
					cout<<x1<<endl;
					break;
			    }
			i++; 
		}

	}
	return 0;
}

C++: #include <iostream>

#define abs(x) ( x>0.000000 ? x : -x )

double third_root( double x, double q) {
	double x2 = x - (x*x*x - q)/( 3 * x*x );
	if( abs( x2*x2*x2 - q )<0.00001*q ) return x2;
	return third_root( x2, q);
}

int main() {
	int n;
	while( std::cin >> n) {
		std::cout << third_root( (double)n / 2.0, (double)n ) << std::endl;
	}
	return 0;
}

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

using namespace std;

int main() {
	long long int n;
	while (cin >> n) {
		if (n == -1) {
			break;
		}
		long double q;
		q = pow((long double)n, 1.0/3.0);
		/*
		q = (long double)n / 2.0;
		while (q > 1300 || q < -1300 || fabs(q*q*q-n) >= 0.00001*q) {
			q = (2.0 * q / 3.0) + ((n/3.0)/q)/q;
		}*/
		printf("%.6f\n", q);
	}
	return 0;
}

C++: #include <stdio.h>double zenka(double q){    double x=q/2;        while(x*x*x-q>=0.00001*q || x*x*x-q<=-0.00001*q)    {        x=x-((x*x*x)-q)/(3*x*x);    }        return x;}int main(void){    int q;        while(1)    {        scanf("%d",&q);        if(q==-1) break;        else        {            printf("%.7f\n",zenka(q));        }    }        return 0;}

C++: #include <cmath>
#include <cstdio>
#include <iostream>
int main(){
	int q;
	while(std::cin>>q,q!=-1){
		double x=q/2.0,a;
		while(1){
			a=x*x*x-q;
			if(fabs(a)<1e-5*q)break;
			x-=a/3/x/x;
		}
		printf("%.6f\n",x);
	}
}

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(fabs(x[i]*x[i]*x[i]-q)>=1e-5*q);
    }
    for(int j=0;j<i;j++){
        printf("%.6f\n",x[j]);
    }
}

C++: #import<cstdio>
#import<cmath>
int main(){int q;float x;for(;scanf("%d",&q),~q;printf("%f\n",x))for(x=q/2.;fabs(x*x*x-q)>1e-5*q;x-=(x*x*x-q)/(3*x*x));}

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

using namespace std;

int main(){
	
	double q, x;
	
	while(true){
		
		scanf("%lf", &q);
		
		if(q < 0){
			break;
		}
		
		x = q / 2;
		
		while(true){
			if(abs(x * x * x - q) < q * 0.00001){
				break;
			}
			x -= (x * x * x - q) / (3 * x * x);
		}
		
		printf("%.10f\n", x);
		
	}
	return 0;
}

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)
{
    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 <sstream>
#include <string>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <limits>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <complex>

using namespace std;

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

#define INF (INT_MAX/3)
#define PI (2*acos(0.0))
#define EPS (1e-8)

typedef long long ll;
typedef unsigned long long ull;

int main(){
  ios_base::sync_with_stdio(0);
  int q;
  while(cin >> q, q != -1){
    double ans = q / 2.0;
    while(100000 * fabs(pow(ans, 3) - q) >= q){
      ans = ans - (pow(ans, 3) - q) / (3 * pow(ans, 2));
    }
    printf("%.6f\n", ans);
  }
  return 0;
}

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

using namespace std;

int main() {
	long long int n;
	while (cin >> n) {
		if (n == -1) {
			break;
		}
		long double q;
		q = (long double)n / 2.0;
		while (q > (2 << 9) || fabs(q*q*q-n) >= 0.00001*q) {
			q = (2.0 * q / 3.0) + ((n/3.0)/q)/q;
		}
		printf("%.6f\n", q);
	}
	return 0;
}

C++: //58
#include<iostream>
#include<cmath>
#include<iomanip>

using namespace std;

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

C++: //C++14 (Clang 3.8.0)

#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#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 <ctime>
#include <string>
#include <climits>
using namespace std;
typedef long long ll;
typedef pair<long long,long long> P;

int main(){
  while(1){
    double n;
    cin>>n;
    if(n==-1.0)break;
    double x=n/2;
    while(1){
      if(abs(x*x*x-n)<0.00001*n)break;
      x=(x-((x*x*x)-n)/(3*x*x));
    }
    printf("%.6lf\n",x);

  }

}

C++: #include<iostream>
#include<cmath>
using namespace std;
int main() {
	double q;
	while (cin >> q, q != -1) {
		if (q == -1)return 0;
		double x = q / 2;
		while (abs(x*x*x - q) >= 0.00001*q) 
			x = x - ((x*x*x - q) / (3 * x*x));
		cout << x << endl;
		cout << x*x*x << endl;
	}
}

C++: #include <iostream>
#include <cmath>
#include <cstdio>
using namespace std;
#define EPS 1e-5
int main(void){
  double q,x;
  int times;


  while(cin >> q){
	if(q == -1) break;
	x = q / 2;
	
	while(fabs(pow(x,3) - q) >= EPS * q){
	  x = x - (pow(x, 3) - q) / (3 * pow(x,2)); 
	}
	printf("%.6f\n", x);
  }
}

C++: #include <iostream>
#include <iomanip>
#include <vector>
#include <cmath>
using namespace std;
double q;
double cal(double n){
  double ans;
  while(1){
    ans = n - n/3.0 - q/(3.0*n*n);
    if(fabs(fabs(ans*ans*ans)-fabs(q)) < 0.0000000001){
      return fabs(ans);
    }
    n = ans;    
  }
}

int main(){
  while(cin >> q,q != -1){
    cout  << fixed << setprecision(7) << cal(q/2.0) << endl;
  }
  return 0;
}