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]))
	}

}

Python: while True:
    n=int(input())
    if n==-1:
        break
    
    x=n/2
    while abs(x**3-n)>=0.00001*n:
        x=x-(x**3-n)/(3*x**2)
    print(f'{x:.6f}')

Python: ans=[]
def zen(x,q):
    return x-(x**3-q)/(3*x**2)
while True:
    q=input()
    if q==-1:
        break
    x=float(q/2)
    while (abs(x**3-q) >= 0.00001*q):
        x=zen(x,q)
    ans.append(x)
    
for i in ans:
    print ('%.6f' % i)

Python: while True:
    q = int(input())
    if q == -1:
        break
    x = q / 2
    while True:
        if abs(x ** 3 - q) < 10 ** -5 * q:
            break
        x = x - (x ** 3 - q) / (3 * x * x)
    print(x)

Python: # coding: utf-8
# Your code here!

while True:
   q = int(input())
   if q == -1: break
   
   x = q / 2
   while abs(x ** 3 - q) >= 0.00001 * q:
      x = x - (x ** 3 - q) / (3 * x ** 2)
   print(x)

Python: while True :
    q = int(input())

    if q == -1 :
        break

    else :
        x = q / 2

        while abs(x ** 3 - q) >= 0.00001 * q :
            x -= ((x ** 3 - q) / (3 * x ** 2))

        print(f"{x:.6f}")

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

using namespace std;

int main()
{
	double n;
	
	while (cin >> n, n != -1){
		n = pow(n, 1.0 / 3.0);
		cout << n << endl;
	}
	return (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,alt1,alt2;
	while(1){
		cin>>q;
		if(q==-1)break;
		alt1=q/2;
		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 <iostream>
#include <iomanip>
#include <cmath>

using namespace std;

const double eps = 0.00001;
double q;

inline double next_x(double x)
{
    return x - (x * x * x - q) / (3 * x * x);
}

int main()
{
    cout << fixed << setprecision(6);

    while (cin >> q, q != -1) {
        double xn = q / 2;

        while (abs(xn * xn * xn - q ) >= eps * q) 
            xn = next_x(xn);

        cout << xn << endl;
    }

    return 0;
}

C++: #define _USE_MATH_DEFINES
#include "bits/stdc++.h"
using namespace std;

//#define int long long
#define DBG 1
#define dump(o) if(DBG){cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) if(DBG){cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define each(it,c) for(auto it=(c).begin();it!=(c).end();it++)
#define all(c) c.begin(),c.end()
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9 + 7);
const double EPS = 1e-10;

signed main() {
	double q;
	while (cin >> q, q != -1) {
		double x = q / 2;
		while (fabs(x*x*x - q) >= (0.00000001)*q) {
			x = (x - ((x*x*x - q) / (3 * x*x)));
		}
		cout << x << endl;
	}
	return 0;
}

C++: #include<cstdio>
#include<cmath>
using namespace std;
int Q;
double q,x,eps;
int main()
{
	for(;scanf("%d",&Q),Q!=-1;)
	{
		q=1.0*Q;
		eps=q*0.00001;
		x=1.0*Q/2;
		for(;abs(pow(x,3)-Q)>=eps;)
		{
			x=x-(pow(x,3)-Q)/(3*pow(x,2));
		}
		printf("%lf\n",x);
	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <cmath>
#include <iomanip>
using namespace std;
int main(void){
    long long q;
    double x[100], x1;
    while(cin >> q){
        if(q == -1) break;
        x[1] = q/2;
        for(int i = 2; ; i++){
            x[i] = x[i-1]-(x[i-1]*x[i-1]*x[i-1]-q)/(3*x[i-1]*x[i-1]);
            if(abs(x[i]*x[i]*x[i]-q) < 0.00001*q){
                x1 = x[i]; 
                break;
            }
        }
        cout <<fixed;
        cout << setprecision(7) << x1 << endl;
    } 
    return 0;
}

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

using namespace std;

int main()
{
	int q;
	while (true) {
		cin >> q;
		if (q==-1) break;
		
		double q_ = static_cast<double>(q);
		double x = 0.5 * q_;
		while ( abs(x*x*x - q_) >= 0.00001 * q_ ) {
			x -= (x*x*x - q_) / (3.0*x*x);
		}
		cout << fixed << setprecision(6) << x << endl;
	}
	
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <fstream>
#include <cmath>

using namespace std;

int main(){

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

	return 0;
}

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

using namespace std;

typedef long long LL;
typedef long double LB;

int main(){

	LL q;
	LB x;

	while(1){

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

		x=(LB)q/2;
		while(abs(x*x*x-q)>=0.00001*q){
			x=x-(x*x*x-q)/(3*x*x);
		}
		printf("%.6f\n",x);
	}
}

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

int main(){
	int q;
	while ( cin >> q && q != -1 ){
		double x = static_cast< double >( q ) / 2;
		while ( ( ( x * x * x - q ) > 0 ? ( x * x * x - q ) : -( x * x * x - q ) ) >= 0.00001 * q ){
			x -= ( x * x * x - q ) / ( 3 * x * x );
		}

		cout << setprecision( 6 ) << setiosflags( ios::fixed );
		cout << x << endl;
	}
	return 0;
}

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

typedef long long ll;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back
#define INF 999999999

int main(){
    int q;
    while(cin>>q){
        if(q==-1)break;
        
        double a,b;
        b=q/2.0;
        while(1){
            a=b-( (b*b*b-q)/(3*b*b) );
//            cout<<a<<endl;
            if(abs(a*a*a-q)<0.00001*q)break;
            swap(a,b);
        }
        printf("%.10lf\n",a);
    }
}

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

void solve(long long q) {
    long double x = q / 2.0;
    while(abs(x*x*x - q) >= 0.00001*q) {
        x = 1.0 * x - (x*x*x - q) / (3 * x*x);
    }
    printf("%.15Lf\n", x);
}

int main() {
    long long q;
    while(~scanf("%lld",&q)) solve(q);
}

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

int main(){

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

	return 0;

}

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

int main() {
  int q;
  double x, xx, e;
  cout.setf(ios::fixed);
  while (cin >> q) {
    if (q == -1) break;
    x = q*0.5;
    while (1) {
      xx = x*x;
      e = xx*x - q;
      if (abs(e) < 1.0e-5 * q) break;
      x = x - e/(3.0*xx);
    }
    cout.precision(6);
    cout << x << endl;
  }
  return 0;
}

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

double ans(int q,long double x){
	x=x-(x*x*x-q)/(3*x*x);
	if(x*x*x-double(q)<0.00001*double(q)){
		return x;
	}else{
		return ans(q,x);
	}
	
}


int main(){
	int q;
	long double x;
	while(scanf("%d",&q),q!=-1){
		x=ans(q,double(q)/2);
		cout<<x<<endl;
	}
}

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

int main(){
	cout << fixed;
	cout << setprecision(10);
	while(1){
		int q;
		cin >> q;
		if(q == -1) break;
		
		double x = (double)q/2;
		while(abs(x*x*x -q) > 1e-5 *q){
			x = x - (x*x*x -q)/(3*x*x);
		}
		cout << x << endl;
	}
	return 0;
}