Chinaunix首页 | 论坛 | 博客
  • 博客访问: 102336
  • 博文数量: 102
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 1011
  • 用 户 组: 普通用户
  • 注册时间: 2014-01-15 13:58
个人简介

普普通通一个人

文章分类

全部博文(102)

文章存档

2018年(1)

2015年(13)

2014年(88)

我的朋友

分类: C/C++

2014-01-15 14:17:24


点击(此处)折叠或打开

  1. /* caculate the circle */
  2. /* Input: radius */
  3. /* Output:caculate the diameter perimeter and area */
  4. #include<stdio.h>
  5. int main(){
  6.     /* declaration */
  7.     int int_radius;
  8.     /* declaration */
  9.     float float_Pi = 3.14159;
  10.     /* prompt */
  11.     printf("Please Enter the radius: ");
  12.     /* prompt */
  13.     scanf("%d", &int_radius);
  14.     /* caculate the diameter */
  15.     printf("The diameter is: %d\n", int_radius * 2);
  16.     /* caculate the perimeter */
  17.     printf("The perimeter is: %f\n", int_radius * 2 * float_Pi);
  18.     /* caculate the area */
  19.     printf("The area is: %f\n", int_radius * int_radius * float_Pi);
  20.     
  21.     return 0;
  22. }


阅读(220) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~