/* Note:Your choice is C IDE */
#include "stdio.h"
/*2. 输入一个圆半径(r)当r>=0时,
计算并输出圆的面积和周长,否则,输出提示信息。
*/
void main()
{
   int r,j,i;
  printf("输入圆的半径:",r);
  scanf("%d",&r);  
  if(r>=0)
  {
      i = r*r*3.14;
      j = 2*r*3.14;
      printf("圆的面积:%d\n",i);
      printf("圆的周长:%d",j);
  }
  else
  {
      printf("输入有误");
      }
}

 

相关文章:

  • 2022-02-02
  • 2021-10-24
  • 2022-12-23
  • 2022-12-23
  • 2022-02-06
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-07-09
  • 2022-12-23
  • 2022-02-21
  • 2022-12-23
  • 2022-12-23
  • 2018-10-30
相关资源
相似解决方案