求助,程序挑错,

[复制链接]
查看11 | 回复2 | 2010-10-20 19:50:14 | 显示全部楼层 |阅读模式
#include

#define PI 3.1415926
int main()

{double s,v,r,h;

scanf("%f%f",&r,&h);
s=2*PI*r*h;

v=PI*r*r*h;

printf("s=%.2f,v=%.2f",s,v);

return 0;
}
为什么输出总是s=-00.00 v=00.00
那该怎么办啊

回复

使用道具 举报

千问 | 2010-10-20 19:50:14 | 显示全部楼层
#include
#define PI 3.1415926void main(){ float s,v,r,h; scanf("%f%f",&r,&h); s=2*PI*r*r+2*PI*r*h; v=PI*r*r*h; printf("s=%f,v=%f",s,v);}
回复

使用道具 举报

千问 | 2010-10-20 19:50:14 | 显示全部楼层
你这本来就是错的程序 也不知道你哪里弄来的
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行