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

xle

Posted by deep_you at 2005-03-01 15:04:29 on Problem 1152
In Reply To:谁可以帮帮我? Posted by:deep_you at 2005-02-27 22:16:43
> #include <stdio.h>
> #define outerror() {printf("such number is impossible!\n");break;}
> void main()
> {
>  char str[1000];
>  int x,max=0;
>  char* ch;
>  while(scanf("%s",str)==1)
>  {
>   ch=str; 
>   max=0;x=0;
>   while(*ch)
>   {
>    if(str[0]=='0')outerror();
>    if((*ch>='0')&&(*ch<='9'))x=*ch-'0';
>      else if((*ch>='A')&&(*ch<='Z'))x=*ch-'A'+10;
>        else x=*ch-'a'+36;
>    if(x>max)max=x;
>    ch++;
>   }
>   if(max!=0)printf("%d\n",max+1);
>  }
> }

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