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:这道题的输入怎么解决啊?即没指定test数据的个数,又没说在什么条件下结束数据输入。

Posted by 041221125 at 2005-07-26 14:09:18 on Problem 1604
In Reply To:这道题的输入怎么解决啊?即没指定test数据的个数,又没说在什么条件下结束数据输入。 Posted by:radish at 2005-02-18 23:26:15
> #include <stdio.h>
> int main()
> {
>     int N;
>     while(1)
>     {
>         scanf("%d",&N);
>         if(N<0||N>10000)
>         break;
>         printf("%5d",N);
>         printf(" -> ");
>         printf("%d\n",compute(N));
>     }
> }
> 
while(scanf("%d",&N)!=EOF){...}
> #include <stdio.h>
> int main()
> {
>     int N;
>     while(scanf("%d",&N))
>     {
>         break;
>         printf("%5d",N);
>         printf(" -> ");
>         printf("%d\n",compute(N));
>     }
> }

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