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 925 (Div. 3) 1931D. Divisible Pairs Solution

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

Powered by Blogger.