TopH Circles in a Rectangle Solution

Solve in C++:

#include<bits/stdc++.h>
using namespace std;
int main()
{


    int t,i;
    scanf("%d",&t);
    for(i=1; i<=t; i++)
    {
         double m,n,ra,ca,r,ans;
        scanf("%lf",&r);
        m=r*4.00;
        n=r*2.00;
        ra=m*n;
        ca=3.1416*r*r;

        ans=ra-(2*ca);
        printf("Case %d: %.2lf\n",i,ans);
        ans=0;

    }

}

No comments

Most View Post

Recent post

Codeforces Round 971 (Div. 4) 2009C. The Legend of Freya the Frog Solution

  Problem Link    https://codeforces.com/contest/2009/problem/C S olution in C++: /// Author : AH_Tonmoy #include < bits / stdc ++. h ...

Powered by Blogger.