| ||||||||||
| 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 | |||||||||
我的用C写的为什么总是在输入数据时总是输入13次呢,不应该的啊。那个大哥大姐帮帮忙看一下吧#include<stdio.h>
main()
{
float monthmoney[13],sum=0,average=0;
int i;
for(i=0;i<12;i++)
{
scanf("%f\n",&monthmoney[i]);/*这一行运行的时候怎么总是让输入13个数据呢*/
}
for(i=0;i<12;i++)
{
sum=sum+monthmoney[i];
}
average=(float)sum/12;
printf("%.2f",average);
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator