- # include <stdio.h>
- int main(void)
- {
- float a,b,c;
- float density,cubage,weight;
- char ch
- do
- {
- printf("请输入长方体的长a=");
- scanf("%f",&a);
- printf("请输入长方体的宽b=");
- scanf("%f",&b);
- printf("请输入长方体的高c=");
- scanf("%f",&c);
- printf("请输入长方体的重量weight");
- scanf("%f",&weight);
- cubage=a*b*c;
- density=weight/cubage;
- printf("长方体的体积为:%f\n",cubage);
- printf("长方体的密度为: %f\n",density);
- printf("您想继续么(Y/N): ");
- scanf(" %c", &ch);
- }while ('y'==ch || 'Y'==ch);
- }
复制代码 这个程序哪里有错误啊?不吝请教!
|
|