#include <stdio.h>#include<math.h>int main(){ double pi=2*acos(0.0),R,B,H; char m; scanf("%c",&m); switch(m) { case 'c': { scanf("%lf",&R); printf("Circle with area %0.2lf\n",pi*R*R); break; } case 't': { scanf("%lf %lf",&B,&H); printf("Triangle with area %0.2lf\n",0.5*B*H); break; } } return 0;}
No comments