7,26改的别人代码

#include<stdio.h>
int main(void)
{
	double height,radius,tarea;
	double carea(double r);
	double rarea(double r,double h);
	printf("Enter tadius and height:");
	scanf("%f %f",&radius,&height);
	tarea=(2*carea(radius)+rarea(radius,height));
	printf("Totalarea=%.3f\n",tarea);
	return 0;
}


double carea(double r)
{
	double result;
	result=3.1415926*r*r;
	return result;
}

double rarea(double r,double h)
{
	double result;
	result=2*3.1415926*r*h;
	return result;
}

  

posted @ 2013-07-26 12:42  herizai  阅读(220)  评论(0编辑  收藏  举报