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 <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>

using namespace std;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define fi first
#define se second

#define PI acos(-1.0)
#define INF 1000000007

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<double, double> PD;
typedef pair<string, ll> PS;
typedef vector<ll> V;

double q, x;

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

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;) {
		double x1, x2;
		x1 = x2 = q / 2.0;
		while (abs(x2*x2*x2 - q) >= 0.00001*q) {
			swap(x1, x2);
			x2 = x1 - (x1*x1*x1 - q) / (3 * x1*x1);
		}
		cout << x2 << endl;
	}
	return 0;
}

C++: #include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <list>
#include <iostream>
#include <climits>
#include <cfloat>

using namespace std;

int main()
{
	while (true)
	{
		int q;
		scanf("%d", &q);
		if (q == -1)
			break;

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

	return 0;
}

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

int main(){
  double q,x,EPS;
  while(true){
    cin >> q;
    if(q == -1)break;
    EPS = 0.00001*q;
    x = q/2;
    while(fabs(q-pow(x,3)) > EPS){
      x = x-(pow(x,3)-q)/(pow(x,2)*3);
    }
    printf("%.6f\n",x);
  }
  return 0;
}

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

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


int main(){
	int q;
	double x;
	while(scanf("%d",&q),q!=-1){
		x=ans(q,double(q)/2);
		printf("%lf\n",x);
	}
}

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;
double rec(double x,double q){
      return x-((x*x*x-q)/(3.0*x*x));
}
int main(){
      double q;
      while(cin>>q&&q!=-1){
            double x=(q/2.0,q);
            REP(i,100000){
                  x=rec(x,q);
            }
            printf("%.10f\n",x);
      }
}

C++: #include<bits/stdc++.h>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<algorithm>
using namespace std;

int main(){
    double tmp[20][2];
    int cnt=0;
    int n;
    for (;;) {
        scanf("%d",&n);
        if (n==-1) break;
        double ans=1.0*n/2.0;
        while (abs(ans*ans*ans-n)>0.00001*ans) ans-=(ans*ans*ans-n)/(3*ans*ans);
        printf("%.8lf\n",ans);
    }
    return 0;
}

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

bool eq(double x,double y){
  if(abs(x-y)<0.00001*y)return true;
  else return false;
}

int main(void){
    long long q;
    double x[100], x1;
    while(cin >> q){
        if(q == -1) break;
        x[1] = q/2.0;
        for(int i = 2; ; i++){
            x[i] = x[i-1]-(x[i-1]*x[i-1]*x[i-1]-(double)q)/(3*x[i-1]*x[i-1]);
            if(eq(x[i]*x[i]*x[i],(double)q)){
                x1 = x[i]; 
                break;
            }
        }
        cout <<fixed;
        cout << setprecision(7) << x1 << endl;
    } 
    return 0;
}

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

#define EPS 1e-6

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

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

using namespace std;

int main(void){

  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",x);
    cout << endl;
  }

  return 0;
}

C++: #include <iostream>
#include <fstream>
#include <typeinfo>
#include <vector>
#include <cmath>
#include <set>
#include <map>
#include <string>
#include <algorithm>
#include <cstdio>
#include <queue>
#include <iomanip>
#include <cctype>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<25;
const double pi=acos(-1);
const double eps=1e-8;
const vi emp;

int q;

int main(){
	cout<<syosu(9);
	while(1){
		cin>>q;
		if(q==-1) break;
		cout<<pow(q,(double)1/3)<<endl;
	}
}

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


bool eq(double x,double y){
  if(abs(x-y)<EPS*y)return true;
  else return false;
}

long long  n;
double t[1000000];
int main(){
  while(cin>>n){
    if(n==-1)break;
    t[1]=n/2.0;
    for(int i=1;i<1000000;i++){
      if(i==1)t[i]=n/2.0;
      else t[i]=t[i-1]-(t[i-1]*t[i-1]*t[i-1]-(double)n)/(3.0*t[i-1]*t[i-1]);

      if(eq(t[i]*t[i]*t[i],(double)n)){
	//cout<<t[i]<<endl;
	printf("%.6f\n",t[i]);
	break;
      }
    }
    
  }
}

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

using namespace std;

int main(){
  double q,x;
  while(cin>>q){
    if (q==-1)break;
    x = q/2;
    while(abs(x*x*x-q)>=0.00001*q){
      x = x-(x*x*x-q)/(3*x*x);
    }
    cout<<x<<endl;
  }
}