赞
踩
输入正方体的边长,计算正方体的面积和体积
#include <stdio.h> float area(float d); float v(float d); void main(){ float d; printf("enter orthogonal's side length:"); scanf("%f",&d); printf("The orthogonal's volume is:%1.2f\n",v(d)); printf("The orthogonal's area is:%1.2f\n",area(d)); } float area(float d){//面积 float s; s=6*d*d; return s; } float v(float d){//体积 float v; v=d*d*d; return v; }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。