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 lishiyu1314 at 2009-08-12 11:14:46
//二十六进制的转换
#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:
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