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>
using namespace std;
#define all(vec) vec.begin(),vec.end()
typedef long long int ll;
const ll MOD=1000000007;
const ll INF=1000000010;
const ll LINF=4000000000000000010LL;
const int MAX=310;
const double EPS=1e-8;
int dx[4]={0,0,1,-1};
int dy[4]={-1,1,0,0};
int main(){
	double q;
	while(cin>>q,q!=-1){
		int id=0;
		double dp[100010];
		dp[0]=q/2;
		while(abs(pow(dp[id],3)-q)>EPS){
			dp[id+1]=dp[id]-(pow(dp[id],3)-q)/(3*pow(dp[id],2));
			id++;
		}
		printf("%.8lf\n",dp[id]);
	}
		
}

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

const double EPS = 1e-5;

double q;

int main()
{
	while( std::cin >> q, q != -1 )
	{
		double prv = q / 2.0, crt;

		do
		{
			crt = prv - ( pow( prv, 3.0 ) - q ) / ( 3 * pow( prv, 2.0 ) );
			prv = crt;
		}while( abs( pow( crt, 3.0 ) - q ) >= EPS * q );

		std::cout << std::setprecision( 7 ) << crt << std::endl;
	}

	return 0;
}

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


int main(){
	int q;
	while(cin>>q&&~q){
		double x=q/2.;
		while(1e-5*q <= fabs(x*x*x-q)){
			x = x-(x*x*x-q)/(3*x*x);
		}
		printf("%.8f\n",x);
	}
	return 0;
}

C++: #include<cstdio>
#include<cmath>
int main(void){
  double q,x;
  for( ; ; ){
    scanf("%lf",&q);
    if(q == -1) break;
    x = q / 2;
    while(fabs(pow(x,3) - q) >= 0.00001 * q) x = x - ((pow(x,3) - q) / (3 * pow(x,2)));
    printf("%.6f\n",x);
  }
}

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

double thirdRoot(double x, double q){
	double next_x;
	if (fabs(x*x*x - q) < 0.00001) {
		return x;
	}else {
		next_x = x - ((x*x*x-q) / (3.0*x*x));
		return thirdRoot(next_x, q);
	}
}

int main(){
	double n;

	while (cin >> n) {
		if (n == -1) {
			break;
		}
		cout << setprecision(20);
		cout << thirdRoot(n/2.0, n) << endl;
		
	}
	return 0;
}

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

double q;

int main() {
  while (1) {
    scanf("%lf", &q);
    if (q == -1.0) return 0;
    
    double ans = q/2;
    while (abs(ans*ans*ans - q) >= 10e-5*q) {
      ans = ans - (ans*ans*ans-q)/(3*ans*ans);
    }

    printf("%f\n", ans);
  }
}

C++: #include <iostream>
#include <stdio.h>
using namespace std;
int main(){
	double x,q;
	while(cin>>q){
		if(q==-1) break;
		x = q/2;
		while(1){
			x=x-(x*x*x-q)/3/x/x;
			if(x*x*x-q < q*0.00001 && x*x*x-q > -q*0.00001) break;
		}
		printf("%.6lf\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 (1) {
			double n = pow(x, 3) - q;
			if (fabs(n) < 0.00001)
				break;
			x = x - (n / (3 * pow(x, 2)));
		}
		cout << fixed << setprecision(7) << x << endl;
	}
	return 0;
}

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

using namespace std;

int in;
long double judge;

int getketa(int in){
  int sum = 0;
  while(in){
    in/=10;
    sum++;
  }
  return sum;
}

void make(){
  int keta = getketa(in);
  judge = in;
  for(int i = 0; i < 5+keta; i++) judge *= 0.1;
  judge += 0.00001;
  // cout << judge << endl;
}
int main(){

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

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

//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(1){
			double c = (x*x*x-q);
			x = x-c/(3*x*x);
			
			if(abs(c) < q*EPS){
				printf ("%.6f\n", x);
				//cout.setf(ios::fixed);
				//cout.precision(6);
				//cout << x << endl;
				break;
			}
		}
	
	}
}

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 > 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 <vector>
#include <iostream>
#include <utility>
#include <algorithm>
#include <string>
#include <deque>
#include <queue>
#include <tuple>
#include <queue>
#include <functional>
#include <cmath>
#include <iomanip>
#include <map>
#include <set>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
#include <complex>
#include <iterator>
#include <array>
#include <memory>
#include <stack>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define all(in) in.begin(), in.end()
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
#define MAX 9999999
using namespace std;
typedef pair<int, int> pii;
typedef pair<double,double>pdd;
typedef pair<ll,ll>pll;
int main(){
    int n;
    while(cin>>n,n!=-1){
        ld hoge=(ld)n/2;
        while(true){
            if(abs(hoge*hoge*hoge-(ld)n)<0.00001*n){
                printf("%Lf\n",hoge); break;
            }
            hoge=hoge-(hoge*hoge*hoge-n)/(3*pow(hoge,2));
        }
    }
}

C++: #include<bits/stdc++.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define itrep(it, a) for(it = (a).begin(); it != (a).end(); it++)
#define all(a) (a).begin(), (a).end()
#define debug(x) cout << "debug " << x << endl;
#define INF (1 << 30)
using namespace std;

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

C++: #include<iostream>
#include<cmath>
#include<iomanip>
using namespace std;
int main(){
	double x,q;
	
	while(cin>>q){
		if(q==-1)break;
		
		x=q/2;
		
		while(fabs( x*x*x-q ) >= 0.00001f * q){
			x = x - (x*x*x-q)/(3*x*x);
		}
		
		cout << setprecision(10) << x << endl;
	}
}

C++: #include<bits//stdc++.h>
using namespace std;
int main(){
	int a;
	while(true){
		cin>>a;
		if(a==-1) {break;}
		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;
}