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

怎么连scanf都出错啊

Posted by qiyuededao at 2012-07-10 15:54:21 on Problem 1003
#include <stdio.h>
#include <stdlib.h>

int main()
{
    float c[100];
    float sum=0.00;
    int i=1,n,j=2;
    do
      {scanf("%f\n",&c[i]);printf("%d\n",i);
      i++;printf("%d\n",i);
      }
    while(c[i-1]!=0.00);

    n=i-1;
    for(i=1;i<n;i++)
    {while(sum<c[i]){
      sum+=1/j;
      j++;
     }
    printf("%d\n",j-2);}
}


第一次送数据进去,后面的printf根本都没反应啊

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