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 <cmath>

int main(){
    int q;
    double x;
    while(1){
        std::cin >> q;
        if(q == -1){
            return 0;
        }
        x = q / 2.0;
        while(std::abs(x * x * x - q) >= 0.00001d * q){
            x = x - (x * x * x - q) / 3 / x / x;
        }
        std::cout << x << std::endl;
    }
}

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

int main()
{
    int q;
    while(cin >> q)
    {
        if(q==-1)break;
        double qz = (double)q;
        double x=qz/2;
        double e;
        while(1)
        {
            e = x*x*x-qz;
            x= x-e/(3*x*x);
            if(fabs(e)*1000000 < qz) break;
        }
        printf("%.7f\n",x);
    }
    

    return 0;
}

C++: #include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
#define EPS 1e-5
using namespace std;

int main() {
	double q;
	while (cin >> q, q != -1.) {
		double x = q / 2;
		while (abs(x*x*x - q) >= EPS) {
			x -= (x*x*x - q) / (3*x*x);
		}
		printf("%6lf\n", x);
	}
}

C++: #include<iostream>
#include<cmath>
#include<iomanip>
using namespace std;
int x;
int main() {
	while (true) {
		cin >> x; if (x == -1) { break; }
		cout << fixed << setprecision(20) << pow(x, 1.0 / 3) << endl;
	}
}

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

int main() {
	while (1) {
		long long q;
		double x;
		cin >> q;
		if (q == -1) break;
		x = (double)q / 2;
		while (fabs(x*x*x - q) >= 1e-5*q) {
			x = x - (x*x*x - q) / (3 * x*x);
		}
		printf("%.6f\n", x);
	}
}

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<cstdio>
#include<cmath>
using namespace std;
int main(){
int in;
while(cin>>in,in+1){
double x=in/2;
while(x*x*x-in>0.00001*in||x*x*x-in<-0.00001*in)
x-=(x*x*x-in)/(3*x*x);
printf("%.9f\n",x);
}
}

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

int main() {
  
  double q;
  while( cin >> q, q >= 0 ) {
    printf("%0.6lf\n", pow( q, 1.0/3 ));
  }
  
  return 0;
}

C++: #include <stdio.h>
#include <math.h>
#define EPS 0.00001

int main(void) {
	int n,i;
	double x;
	double x2;
	double x3;
	while (scanf("%d", &n), n!=-1) {
		x = (double)n / 2;
		i = 0;
		x3 = x * x * x;
		while (!(fabs(x3-n)< EPS*(double)n)){
			x2 = x * x;
			x3 = x * x * x;
			x = x - ((x3 - n) / (3 * x2));
			i++;
		}
		printf("%f\n", x);
	}
	return 0;
}

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

using namespace std;

int main(int argc, char const* argv[])
{
	double answer;
	double q;

	while( cin >> q && q != -1 ){
		answer = q / 2;

		while( fabs( answer * answer * answer - q ) >= 0.00001 * q ){
			answer = answer - ( (answer * answer * answer ) - q ) / ( 3 * answer * answer );
		}

		printf("%.6f\n",answer);
	}
	return 0;
}

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

int q;

bool input() {
	cin >> q;
	if(q == -1)
		return false;
	return true;
}

double solve() {
	double x = (double)q / 2;
	while(fabs(x * x * x - q) >= 0.00001 * q) {
		x = x - (x * x * x - q) / (3 * x * x);
	}

	return x;
}

int main(void) {
	while(input())
		printf("%.6f\n", solve());
}

C++: #include <iostream>
#include <sstream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <queue>
#include <cmath>
#include <set>
#include <map>
#include <cstdlib>
#include <cstdio>
using namespace std;

const double EPS = 1e-9;

double tr(double xn, double q){
	double xn2 = xn*xn;
	double xn3 = xn2*xn;
	if(abs(xn3 - q) < 0.00001*q){
		return xn;
	}
	return tr(xn-(xn3-q)/(3.0*xn2), q);
}

int main(){
	int q;
	while(cin >> q, q != -1){
		cout << tr(q/2.0, q) << endl;
	}

	return 0;
}

C++: #include <cstdio>
#include <cmath>
int main(){
	int q;double 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 <sstream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <queue>
#include <cmath>
#include <set>
#include <map>
#include <cstdlib>
#include <cstdio>
using namespace std;

const double EPS = 1e-9;

double tr(double xn, double q){
	double xn2 = xn*xn;
	double xn3 = xn2*xn;
	if(abs(xn3 - q) < 0.00001*q){
		return xn;
	}
	return tr(xn-(xn3-q)/(3.0*xn2), q);
}

int main(){
	int q;
	while(cin >> q, q != -1){
		printf("%lf\n", tr(q/2.0, q));
	}

	return 0;
}

C++: #include <iostream>
#include <cmath>
#include <cstdio>
using namespace std;
int main(void){
    int a;
    while(cin>>a){
        if(a==-1)break;
        double q = (double)a;
        double x = q/2;
        while(abs(x*x*x-q)>=0.00001*q){
            double nx = x-(x*x*x-q)/(3*x*x);
            x = nx;
        }
        printf("%.6lf\n",x);
    }
    return 0;
}

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

int main()
{
    int q;
    while(cin >> q, q != -1){
        double x = q / 2.0;
        while(1){
            if(abs(x * x * x - q) < 0.00001 * q){
                cout << fixed << x << endl;
                break;
            } else {
                x = x - (x * x * x - q)/(3 * x * x);
            }
        }
        //cout << fixed << cbrt((long double)q) << endl;
    }
}

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(!(fabs(x*x*x-q)<0.00001*q)){
      x=x-(x*x*x-q)/3/x/x;
    }
    cout<<fixed<<setprecision(10)<<x<<endl;
  }
  return 0;
}

C++: #include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
double ZKS(double x,int  q){
	return (x - ((x * x * x) - q) / (3 * x * x));
}

int main(void){
	int q;

	while(cin >> q){
		if(q == -1) break;

		double x1 = q / 2;
		double x = x1;

		while(abs(x * x * x - q) > 0.00001 * q){
			x = ZKS(x,q);
		}

		std :: cout << std :: fixed;
		std :: cout << std :: setprecision(6) << x << endl;
	}

	return 0;
}