• 2022-06-09
    以下程序实现:输入圆的半径r和运算标志m,按照运算标志进行指定计算。标志a计算面积,标志c计算周长,标志b二者均计算。#define PI 3.14159main( ){char m;float r,c,a;printf ("input mark a c or b and r \n");scanf ("%c%f",&m,&r);if (m=='a'){a=PI*r*r;printf("area is %f",a);}if (m=='c' ){c=2*PI*r;printf("circle is %f",c);}if(____){a= PI *r*r;c=2*PI*r;printf("area and circle are %f%f",a,c);}}
  • 举一反三