Skip to content

Instantly share code, notes, and snippets.

@Biazus
Created November 21, 2014 13:09
Show Gist options
  • Save Biazus/1d94ae49dda463ab7cc7 to your computer and use it in GitHub Desktop.
Save Biazus/1d94ae49dda463ab7cc7 to your computer and use it in GitHub Desktop.
10297 - Beavergnaw
#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<cmath>
#include <iomanip>
#define PI 3.14159265
using namespace std;
int main(){
int D,V;
double d;
cin >> D >> V;
while(D!=0 && V!=0){
d = pow(pow(D,3)-6*V/PI, 1.0/3); //d=(D^3-6*V/PI)^1/3
cout << setiosflags(ios::fixed) << setprecision(3) << d << endl;
cin >> D >> V;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment