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

样本测试数据都是对的,但总是wrong answer.请指点一下。。。不胜感激!

Posted by dingchuan at 2007-05-13 21:54:09 on Problem 1003
#include<stdio.h>
void main()
{
  float s=0;
  float a[20];
  int n,i=0;
  printf("input the positive floating-pointing number C:\n");
  scanf("%fn",&a[i]);
  while(a[i]!=0&&i<19)
    {
      printf("\n");
      i++;
      scanf("%f",&a[i]);
    }
  for(i=0;a[i]!=0;i++)
    {
    for(s=0,n=1;s<a[i];n++)
	s+=1.0/(n+1);
      printf("%d card(s)\n",n-1);
    }
    getch();
}

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