| ||||||||||
| 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:比较简短的一个方法,题目的例子能过,自己造一些简单数据也能过,9999的答案是36,但就是WA。为什么?(附C代码)In Reply To:比较简短的一个方法,题目的例子能过,自己造一些简单数据也能过,9999的答案是36,但就是WA。为什么?(附C代码) Posted by:gavinmok at 2006-05-09 13:28:39 > #include<stdio.h>
> void main()
> {
> int num;
> int result,count;
> scanf("%d",&num);
> result=1;count=1;
> while(result%num!=0)
> {
> result=(result%num)*10+1;
> count++;
> }
> printf("%d\n",count);
> }
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator