Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
为什么写成sum/12.0就错 写成sum/12就对了???也没有四舍五入。。???!!!#include<stdio.h> int main() { int i; double a,sum=0.0; for(i=0;i<12;i++) { scanf("%lf",&a); sum+=a; } printf("$%.2f",sum/12); return 0; } 我提交上面的就对了 把倒数第二行最后写成sum/12.0就wa why??? Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator