Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

WA的童鞋要注意了,输入可以是double,输出必须是float,这是大部分WA的原因吧

Posted by Android_2_2 at 2011-06-04 09:39:22 on Problem 1004
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator