Test instructions: The format of the letter string + number and the format of the r+ digital +c+ numbers are converted to each other, each format is used to denote the number of rows;
Idea: Simulation;
#include <iostream>#include<cstdio>#include<cstring>#include<string>using namespacestd;intt,n,m;strings;Chara[500010];intMain () {intI,j,k,temp,len,num; scanf ("%d",&t); while(t--) {cin>>s; Len=s.length (); Temp=s.find ('C'); num=0; if(s[0]=='R'&&s[1]>='0'&&s[1]<='9'&&temp>0){ for(i=temp+1; i<len;i++) {num=num*Ten+ (s[i]-'0'); } J=0; while(num) {if(num% -==0) {A[j]=(Char)'Z'; Num--; } Else{A[j]=(Char) (num% -+'A'-1); } num/= -; J++; } for(i=j-1; i>=0; i--) printf ("%c", A[i]); cout<<S.SUBSTR (1, temp-1) <<Endl; } Else{ for(i=0; i<len;i++){ if(s[i]>='0'&&s[i]<='9') {Temp=i; Break; } } for(i=0; i<temp;i++) {num=num* -+ (s[i]-'A'+1); } cout<<'R'<<s.substr (temp) <<'C'<<num<<Endl; } } return 0;}
Codeforces 1 B Spreadsheets (analog)