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 |
Re:这道题的输入怎么解决啊?即没指定test数据的个数,又没说在什么条件下结束数据输入。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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator