28.(C)#Paknami --->>>>Regular Hexagon area from Toph

 #include <stdio.h>

#include<math.h>

/*Pakna in a wise man. He loves solving problems but always ends up with more problems.

This is obvious as he is best at Paknami. One day he found an interesting problem. 

Given the side length of a regular hexagon. You have to calculate the area of that hexagon.

A regular hexagon means all sides are equal and all angles are equal.

As he is Pakna, he messed up again. Now he asks for your help. */

/*Input

Input begins with an integer T (0 < T ≤ 10000). 

Each of the next T lines contains an integer A (0 < A ≤ 1000) representing

the side length of the hexagon.


Output

For each case print the area of the hexagon.

Errors less than 10-4 will be ignored. */

int main() {

int T;  

scanf("%d",&T);

while(T--)

{   

int A;

float area;

scanf("%d",&A);

area=(3 * sqrt(3) * A * A)/2;

printf("%.5f\n",area);

}

return 0;

}


Comments