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

看看FAQ的第7个问题,scanf后面的那个printf是多余的

Posted by zentropy at 2008-03-09 22:07:19 on Problem 1004
In Reply To:为什么过不了呢???哪里有问题??帮忙啊 ~~~~ Posted by:snowfall at 2008-03-09 21:36:09
> 这是我编的~~
> #include<stdio.h>
> main()
> {
>      float a[12];
>      int i=12;
>      float sum=0;
>      float average;
>      
>      for(i=0;i<12;i++)
>      {
>           scanf("%f",&a[i]);
>           printf("%5.2f\n",a[i]);//这个语句不需要
>      }
>      
>      for(i=0;i<12;i++)
>          sum=sum+a[i];
>          
>       average=sum/12;   
>       
>       printf("$%5.2f",average);
> 
>      getchar();
>      getchar();
>      
> }

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