| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
有没有什么BT的数据啊?怎么例子都过了,就是WA呢?In Reply To:Re:为什么我转换成26进制就超时呢?不可能吧? Posted by:yufuwan1 at 2008-06-08 19:26:42 #include<stdio.h>
#include<string.h>
int main()
{
while(1)
{
__int64 a,b;
__int64 r[100]={0};
int i=1;
int j;
while(getchar()=='\n');
scanf("%I64dC%I64d",&a,&b);
if((a==0)&&(b==0))
return 0;
if(b<=26)
{
printf("%c",b+'A'-1);
printf("%I64d\n",a);
}
else
{
r[0]=b%26;
while(b/26)
{
b/=26;
if(r[i-1]==0)
{
r[i-1]+=26;
b-=1;
}
r[i]=b%26;
i++;
}
for(j=i-1;j>=0;j--)
{
printf("%c",r[j]+'A'-1);
}
printf("%I64d\n",a);
}
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator