/* Note: When a single t is given, we assume R = r
 */
int main(void)
{
    int T, input[MAX_NUM_INPUT], numInput;
    char line[MAX_LEN_LINE + 1];
    double R, r;

    scanf("%d", &T);
    gets(line);

    while(T)
    {
        gets(line);

        numInput = parseInput(line, input);

        if(numInput == 1)
        {
            R = input[0] / 4.0;
            r = R;
        }
        else
        {
            R = (double) input[0];
            r = (double) input[1];
        }
        printf("%.4lf\n", computeCircleArea(R + r)
               - computeCircleArea(R)
               - computeCircleArea(r));
        T--;
    }
    return 0;
}
Exemple #2
0
	int main(){
	printNameCourse();
	float area;
	float radius;
	
	radius = 10;
	area = computeCircleArea(radius);
	
	printf("The Area is %f\n", area);
	
	return 	EXIT_SUCCESS;
}
int main(){
float area;
float radius;

radius = 10;

area = computeCircleArea(radius);

printf("the Area is: %f\n\n", area);



return EXIT_SUCCESS;
}
int main(){

printNameCourse();

printf("\n\n");

float area;
float radius;
radius=10;
area = computeCircleArea(radius);
printf("The area is %f.", area);	

printf("\n\n");

system("PAUSE");
return 0;

}
double computeCircumCircleArea(double a, double b, double c)
{
	return computeCircleArea(a * b * c / (4 * computeTriangleArea(a, b, c)));
}
double computeInCircleArea(double a, double b, double c)
{
	double semiPerimeter = (a + b + c) / 2;

	return computeCircleArea(computeTriangleArea(a, b, c) / semiPerimeter);
}