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

为什么WA?求救大牛们

Posted by shenfangyi at 2006-07-26 11:24:12 on Problem 2273
#include<stdio.h>
main()
{
    unsigned r,c;
    scanf("R%uC%u",&r,&c);
    getchar();
    while(r||c)
    {
        int n=1,t=26*26;
        while(t<c*25+26)t*=26,n++;
        t=c-(t/26-26)/25-1;
        char a[10];
        for(int i=0;i<n;i++)a[i]=t%26+'A',t/=26;
        for(int i=0;i<n/2;i++)
        {
            char x=a[i];
            a[i]=a[n-1-i];
            a[n-1-i]=x;
        }
        a[n]=0;
        printf("%s%u\n",a,r);
        scanf("R%uC%u",&r,&c);
        getchar();
    }
}

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