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 yesiam at 2005-02-27 22:25:46 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);
>  }
> }
题目没读对,注意以下几句话:
you are given the guaranty that R is divisible by (N-1)
No invalid number will be given as input. The largest size of the input file will be 32KB.

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