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 |
WA的童鞋要注意了,输入可以是double,输出必须是float,这是大部分WA的原因吧#include <stdio.h> int main() { double a,sum=0.0; int i; for(i=0;i<12;i++){ scanf("%lf",&a); sum+=a; } printf("$%.2lf\n",sum/12);//这里必须改成《printf("$%.2f\n",sum/12);》,必须 将lf改成f,据Discuss区某位大牛说C89不支持输出lf return 1; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator