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

RESTful APIs with CRUD Operations in Laravel 12| (2025)

  RESTful APIs serve as the foundation of modern web development. They follow a set of rules called Representational State Transfer (REST) t...

Powered by Blogger.