字符串问题 请各位看看

img


请问这题怎么做啊

#include<bits/stdc++.h>
using namespace std;
string yw[10]={"zero","one","two","three","four","five","six","seven","eight","nine"};
string py[10]={"ling","yi","er","san","si","wu","liu","qi","ba","jiu"};
int t;
int main(){
    cin>>t;
    for(int i=1;i<=t;i++){
        char a[105];
        cin>>a;
        for(int i=0;i<10;i++){
            if(a==yw[i]){
                cout<<py[i]<<endl;
                break;
            }
        }
    }
    return 0;
}
#include <stdio.h>
#include <string.h>
int main()
{
    char yw[10][10] = {"zero","one","two","three","four","five","six","seven","eight","nine"};
    char py[10][10] = {"ling","yi","er","san","si","wu","liu","qi","ba","jiu"};
    int T,i,j;
    char w[10] = {0};
    scanf("%d",&T);
    for(i=0;i<T;i++)
    {
        gets(w);
        for(j=0;j<10;j++)
        {
            if(strcmp(w,yw[j]) == 0)
            {
                printf("%s\n",py[j]);
                break;
            }
        }
    }
    return 0;
}

学习map,然后解决。