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:比较简短的一个方法,题目的例子能过,自己造一些简单数据也能过,9999的答案是36,但就是WA。为什么?(附C代码)

Posted by 30 at 2006-09-28 20:17:51 on Problem 2551
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:
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