| ||||||||||
| 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 | |||||||||
可以呀!能运行出来啊!杂麽就WA了?郁闷!//二十六进制的转换
#include<iostream>
using namespace std;
/*void zhuanhuan()
{
int aryshu[26]={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26};
int aryzi[26];
for(int i=0;i<26;i++)
{
int a=65;
aryzi[i]=char(a)
a++;
}
for(int j=0;j<26;j++)
{
aryzi[j]=aryshu[j];
}
return aryzi[26];
}*/
int main()
{
int n,i;
int res;
int shang;
cout<<"please input n=";
cin>>n;
int r,c;
for(i=0;i<n;i++)
{
cout<<"please input r and c: r and c 只能为正整数"<<endl;
cin>>r>>c;
cout<<"R"<<r<<"C"<<c<<endl;
while(shang)
{
res=c%26;
shang=c/26;
c=shang;
cout<<(char)(res+64)<<r;
}
shang=1;
cout<<endl;
}
/* while(shang)
{
shang=c/26;
res=c%26;
c=shang;
cout<<(char)(res+64)<<r;
cout<<endl;
}*/
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator