Run ID:93510

提交时间:2024-10-17 15:04:45

#include <stdio.h> #include <string.h> #include <ctype.h> int main() { char a[101]; int n,m; scanf("%d",&n); for(int i=1;i<=n;i++) { scanf("%s",a); m = strlen(a); char b[101]; int res=0; int t=0; for(int j=0;j<=m;j++) { if(isdigit(a[j]) ) { res = res*10 + (a[j]-'0'); } else if( a[j]=='-') { b[t++] = res-1+65; // b[t++] = ' '; res=0; } else if( a[j]=='#' ) { b[t++] = res-1+65; b[t++] = ' '; res=0; } else if( a[j]=='\0') { b[t++] = res-1+65; res=0; break; } } b[t]='\0'; printf("%s\n",b); } return 0; }