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<iomanip>
#include<cmath>
#include<cstdlib>

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( fabs( pow( crt, 3.0 ) - q ) >= EPS * q );

		std::cout.setf( std::ios::fixed, std::ios::floatfield );
		std::cout << std::setprecision( 6 ) << crt << std::endl;
	}

	return 0;
}

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

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

using namespace std;

int main() {
	long double q;
	while (cin >> q) {
		if (q == (long double)-1.0) {
			break;
		}
		long double x = q / (long double)2.0;
		while (fabs(x*x*x-q) >= 0.00001*q) {
			x = x - (x*x*x-q)/((long double)3.0*x*x);
		}
		printf("%.6lf\n", x);
	}
	return 0;
}

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.000001){
      return fabs(ans);
    }
    n = ans;    
  }
}

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

C++: #include <cstdio>

double abs(double n) {return n>0?n:-n;}

int main() {
  double q;
  while(scanf("%lf",&q), q>0) {
    double x = q/2;
    while (abs(x*x*x-q) >= 0.00001*q)
      x = x-(x*x*x-q)/(3*x*x);
    printf("%lf\n",x);
  }
}

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 <iomanip>
#include <algorithm>
using namespace std;

double t_root(double q){
	double x = q / 2;
	while(max(x * x * x  - q,-(x * x * x - q)) >= 0.000001 * q){
		x = x - (x * x * x - q) / (3 * x * x);
	}
	return x;
}

int main(){
	double q;
	while(cin >> q){
		if(q == -1) break;
		cout << fixed << setprecision(6) <<  t_root(q) << endl;
	}
	return 0;
}

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(8);
	for (int q; cin >> q&&q != -1;) {
		cout << pow(q, 1. / 3) << 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() {
	cout  << setprecision(8);
	double q;
	while (cin >> q, q != -1) {
		double x = q / 2;
		while (abs(x*x*x - q) >= (0.000001)*q) {
			x = x - ((x*x*x - q) / (3 * x*x));
		}
		cout << x << endl;
	}
	return 0;
}

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

#define EPS 1e-5

int main() {
  
  double q;
  while( cin >> q, q >= 0 ) {
    double x = q/2;
    while( fabs( x*x*x - q ) >= EPS ) {
      x = x - ( x*x*x - q ) / ( 3*x*x );
    }
    printf("%f\n", x);
  }
  
  return 0;
}

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

#define FOR(i,l,r) for(int i = (int) (l);i < (int) (r);i++)
template<typename T> bool chmax(T& a,const T& b){ return a < b ? (a = b,true) : false; }
template<typename T> bool chmin(T& a,const T& b){ return b < a ? (a = b,true) : false; }
typedef long long ll;

ll N;

int main()
{
	while(scanf("%lld",&N),N != -1){
		double lo = 0.0,hi = 1e18,mid;
		FOR(i,0,200){
			mid = (lo + hi) / 2.0;
			if(mid * mid * mid <= N){
				lo = mid;
			}
			else{
				hi = mid;
			}
		}
		printf("%.10f\n",lo);
	}

	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 <= abs(x*x*x-q)){
			x = x-(x*x*x-q)/(3*x*x);
		}
		printf("%.8f\n",x);
	}
	return 0;
}

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

	}
	return 0;
}

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<time.h>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define rp(a) while(a--)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double EPS=1e-10;
using namespace std;
typedef long long ll;
typedef vector<int> vi;
int main(){ll n;while(cin>>n,n+1)printf("%.6f\n",pow(n,1/3.0));}

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

using namespace std;

long double thirdroot(long double q);

int main(){
  long double q=0;
  for(;;){
    cin>>q;
    if( q==-1 ) break;
    cout<<thirdroot(q)<<endl;
  }
  return 0;
}

long double thirdroot(long double q){
  long double x=q/2;
  while( abs(x*x*x-q)>=0.00001*q ){
    x-=(x*x*x-q)/(3.0*x*x);
  }
  return x;
}

C++: #include<cstdio>
using namespace std;
int main(void)
{
	int qq;
	double q,x1,x2,xx;
	while(1)	{
		scanf("%d",&qq);
		if(qq==-1)	break;
		q=double(qq);
		x1=q/2.0;
		while(1)	{
			xx=x1*x1*x1-q;
			if(xx<0)	xx=-xx;
			if(xx<0.00001*q)	break;
			x1=x1-(x1*x1*x1-q)/(3.0*x1*x1);
		}
		printf("%lf\n",x1);
	}
	return 0;
}