URI Online Judge Solution| 1011 Sphere

Problem Link: https://www.urionlinejudge.com.br/judge/en/problems/view/1011
Solution:

I first tried to do with float but it was not giving me correct answer for 3rd test case so i have searched in the net for solution the i have seen that i have to use double as double is for 8 byte where as float was for 4 byte

So i have used float and result is correct upto all test cases 🙂

 



  • fuad hossain

    #include

    using namespace std;

    int main(){

    int r;

    float a;

    cin>>r;

    a=(4.0*3.14159*r*r*r)/3;

    cout<<a<<endl;

    return 0;

    }

  • julliard

    THANK YOU SO MUCH!!