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:无意间发现简单的算法!~我是按照你的这个简单算法编的程序~为什么AC不了呢??????牛人指教下!!

Posted by 200830740509 at 2009-08-20 19:41:03 on Problem 1047
In Reply To:Re:无意间发现简单的算法!~我是按照你的这个简单算法编的程序~为什么AC不了呢??????牛人指教下!! Posted by:gaoxingok99 at 2009-08-10 10:01:31
> #include<stdio.h>
> #include<string.h>
> #include<stdlib.h>
> 
> void main()
> {
>     char a[80]={0};
> 	int n;
> 	int i,len,re,ans;
> 	while(scanf("%s",a)!=EOF)
> 	{
> 		len=strlen(a);
> 		n=atoi(a);
> 
> 		re=n*(len+1);
> 		ans=9;
> 		for(i=1;i<len;i++)
> 		{
> 			ans=ans*10+9;
> 		}
> 		if(re==ans)
> 			printf("%s is cyclic\n",a);
> 		else 
> 			printf("%s is not cyclic\n",a);
> 	}
> }
> 
> 
> 
> 
> 
> 
兄弟,高精度乘法,你那个atoi不行的。

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