Run ID:138825
提交时间:2025-11-30 11:05:44
#include <bits/stdc++.h> using namespace std; int main() { int d,e,f,i,j,k,n,s; char a[101],b[101],c[101]; scanf("%d",&n); getchar(); while (n--) { scanf("%s",a); e=i=j=k=0; f=1; while (i<=strlen(a)) { if (a[i]=='#' or a[i]=='-' or i==strlen(a) or j==2) { f=f/10; d=s=0; while (d<j) { s=s+(b[d]-'0')*f; f=f/10; d++; } c[e]=64+s; if (a[i]=='#') { while (a[i]=='#') { c[e+1]=' '; e++; i++; } i--; } else if (a[i]=='-') { while (a[i]=='-') i++; i--; } else if (i!=strlen(a)) i--; e++; j=0; f=1; } else if (j<=1) { b[j++]=a[i]; f=f*10; } i++; } c[e]='\0'; printf("%s\n",c); } return 0; }