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

Re:我的用C写的为什么总是在输入数据时总是输入13次呢,不应该的啊。那个大哥大姐帮帮忙看一下吧

Posted by HunkShen at 2010-03-16 20:13:13 on Problem 1004 and last updated at 2010-03-16 20:13:41
In Reply To:我的用C写的为什么总是在输入数据时总是输入13次呢,不应该的啊。那个大哥大姐帮帮忙看一下吧 Posted by:prehacker at 2009-10-20 09:39:34
> #include<stdio.h>
> main()
> {
> float monthmoney[12],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:
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