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:哪位大哥看看小弟错哪了??

Posted by 3341490044 at 2023-05-10 11:35:27 on Problem 1152
In Reply To:哪位大哥看看小弟错哪了?? Posted by:yiyiyi4321 at 2005-08-04 18:01:30
> #include<stdio.h>
> main()
> {char c[3000];
>  long ten;
>  int d[1000],len,max,i,j,n,;
>  while(scanf("%s",c)!=EOF)
>  {max=2;
>   len=0;
>   while(c[len]!='\0')
>   {if(c[len]>='0'&&c[len]<='9')d[len]=c[len]-'0';
>    if(c[len]>='A'&&c[len]<='Z')d[len]=c[len]-'A'+10;
>    if(c[len]>='a'&&c[len]<='z')d[len]=c[len]-'a'+36;
>    if(d[len]>=max)max=d[len]+1;
>    len++;
>   }
>  for(i=max;i<=62;i++)
>   {ten=0;
>    for(j=0;j<len;j++)
>     ten=ten*i+d[j];
>    if(ten%(i-1)==0){printf("%d\n",i);
> 		   break;}
>   }
>  if(i>62)printf("such number is impossible!\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