用C语言写出下例的流程图:

来源:百度知道 编辑:UC知道 时间:2024/06/28 01:37:11
很急,哪位大哥帮我做一下啊,将非常感谢,,
1. 设计一个程序,实现以下功能:
a. 输入一个圆的直径,求出圆的周长和面积;
b. 输入一个正方形的边长,求出正方形的周长和面积;
c. 输入一个长方形的长和宽,求出长方形的周长和面积;
d. 输入一个三角形的三条边长,求出三角形的周长和面积;
附加要求:制作一个菜单,用以选择将要进行计算的图形类型,譬如选择1为圆,2为正方形,3为长方形,4为三角形,0退出程序。

#include <stdio.h>
#include <math.h>
#define PI 3.1415926
void circle()
{
double d,s,l;
printf("Please input the diameter:");
scanf("%lf",&d);
s=d*d*PI/4;
l=d*PI;
printf("zhou chang is :%lf\n",l);
printf("area is :%lf\n\n",s);
}
void square()
{
double a,l,s;
printf("Please input the bianchang:");
scanf("%lf",&a);
s=a*a;l=4*a;
printf("zhou chang is :%lf\n",l);
printf("area is :%lf\n\n",s);
}
void rectangle()
{
double a,b,l,s;
printf("Please input the length and the widt

#include <stdio.h>
#include <math.h>
#define PI 3.1415926
void circle()
{
double d,s,l;
printf("Please input the diameter:");
scanf("%lf",&d);
s=d*d*PI/4;
l=d*PI;
printf("zhou chang is :%lf\n",l);
printf("area is :%lf\n\n",s);
}
void square()
{
double a,l,s;
printf("Please input the bianchang:");
scanf("%lf",&a);
s=a*a;l=4*a;
printf("zhou chang is :%lf\n",l);
printf("area is :%lf\n\n",s);
}
void rectangle()
{
double a,b,l,s;
printf("Please input the length and the width:");
scanf("%lf %lf",&a,&b);
s=a*b;l=2*(a+b);
printf("zhou chang is :%lf\n",l);
printf("area is :%lf\n\n",s);
}
void triangle()
{
double a,b,c,l,s;
pri