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++: a#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.0*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 <bits/stdc++.h>
using namespace std;

int main(){
//    int a;
    double b,c;
    while(cin>>b){
        c=b/2;
        while(fabs(c*c*c-b)>=b*1e-5){
            c=c-(c*c*c-b)/(3*c*c);
        }
        cout<<c<<endl;
    }
}

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) >= 1e-5*q) {
      ans = ans - (ans*ans*ans-q)/(3*ans*ans);
    }

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

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

void compute(int q){
  double x = q/2.0;
  while(1){
    if ( fabs(x*x*x - q) < EPS*q ) break;
    x = x - (x*x*x - q)/(3*x*x);


  }
  printf("%.6lf\n", x);
}

main(){
  int q;
  while( cin >> q && q >= 0 ) compute(q);
}

C++: #include<cstdio>
#define eps 0.000001
double q;

double fabs(double a){
	if(a<0)return -a;
	return a;
}

int main(void){
	while(1){
		scanf("%lf",&q);
		if(q==-1)break;
		double x=q/2;
		while(fabs(x*x*x-q)>=eps*q){
			x=x-(x*x*x-q)/(3*x*x);
		}
		printf("%0.7f\n",x);
	}
	return 0;
}

C++: #include <iostream>
#include <utility>
#include <algorithm>
#include <string>
#include <vector>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <cstdlib>

typedef long long int ll;


using namespace std;

int q;
double x;

double f(){
	return x*x*x-q;
}
double df(){
	return 3*x*x;
}

double calc(){
	x=q/2.0;
	while(1){
		if((fabs(f())>-0.00001*q&&fabs(f())<0.00001*q)){
			break;
		}
		x=(x*df()-f())/df();
	}
	return x;
}

int main(){
	while(1){
		cin>>q;
		if(q==-1)break;
		printf("%.15lf\n", calc());
	}
}

C++: #include<iostream>
#include<cstdio>
using namespace std;
int main(){
  double q;
  while(cin >>q,q!=-1){
    double ans = q/2;
    for(;;){
      ans = ans-((ans*ans*ans)-q)/(3*ans*ans);
      if(ans*ans*ans-q<q*0.00001 && -q*0.00001<ans*ans*ans-q) break;
    }
    printf("%.6lf\n",ans);
  }
  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;
int main(){
      int q;
      while(cin>>q&&q!=-1){
            double x=(double)q/2.0;
            while(1){
                  if(0.00001*q>abs(x*x*x-q))break;
                  x=x-((x*x*x-q)/(3.0*x*x));
            }
            printf("%.10f\n",x);
      }
}

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

using namespace std;

double f(double x, double q) {
   
    return (x * x * x - q);
}

double df(double x) {
    return (3 * x * x);
}

double newton(double x, double q) {
    
    if(abs(f(x, q)) < 0.00001 * q) {
        return x; 
  }
    return newton(x - f(x, q)/df(x),q);
}

int main(void){
    double x;
    double q;
    while(cin >> q){
        if(q == -1) break;
        x = q/2;
        cout << fixed << setprecision(6) << newton(x,q) << endl;
    }
}

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(1.0*x, 1.0 / 3.0)*1.000001 << endl;
	}
}

C++: #include<iostream>
#include<iomanip>
#include<algorithm>
#include<array>
#include<bitset>
#include<cassert>
#include<cctype>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<functional>
#include<limits>
#include<list>
#include<map>
#include<numeric>
#include<set>
#include<stack>
#include<string>
#include<sstream>
#include<queue>
#include<vector>
using namespace std;

using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define REP(i,n) for(int i=0;i<(n);i++)
#define RREP(i,n) for(int i=(n)-1;i>=0;i--)
#define ALL(a) (a).begin(),(a).end()
#define DUMP(o) {cerr<<#o<<" "<<o<<endl;}
#define DUMPC(o) {cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL
const int MOD = 1e9 + 7;

signed main() {
	cout << fixed << setprecision(6);
	for (int q; cin >> q&&q != -1;) {
		cout << pow(q, 1. / 3) << endl;
	}
	return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<vector>
#include<queue>
#include<algorithm>
#include<cmath>
#include<string>
#include<cstring>
#include<map>
#include<functional>
#include<stack>
#include<list>
#include<set>
#include<deque>
#include<climits>
using namespace std;

double abso(double n){
	if(n<0) return n*=-1;
	return n;
}

int main(){
	int q;
	double x;
	while(cin>>q,q!=-1){
		x = q/2;
		while(abso(x*x*x-q)>=0.00001*q){
			x = x-((x*x*x-q)/(3*x*x));
		}
		printf("%lf\n",x);
	}
	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() {
	cout  <<fixed<< setprecision(8);
	double q;
	while (cin >> q, q != -1) {
		double x = q / 2;
		while (abs(x*x*x - q) >= (0.00000001)*q) {
			x = (x - ((x*x*x - q) / (3 * x*x)));
		}
		cout << x << endl;
	}
	return 0;
}

C++: #include<iostream>
#include<cmath>
using namespace std;
int main() {
	typedef long double ld;
	ld q;
	while (cin >> q) {
		if (q == -1)return 0;
		ld x = q / 2;
		while (x*x*x - q > 0.00001*q) {
			x = x - ((x*x*x - q) / (3 * x*x));
		}
		printf("%.10f\n", x);
	}
}

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

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));
		if (q == -1)return 0;
		cout << x << endl;
	}
}