简单模拟题。
#include<bits/stdc++.h> using namespace std; char s[100010]; int T; int main() { scanf("%d",&T); while(T--) { memset(s,0,sizeof s); scanf("%s",s); for(int i=0;s[i];i++) { if(s[i]=='0'||s[i]=='2'||s[i]=='4'||s[i]=='6'||s[i]=='9') { printf("%c",s[i]); } if(s[i]=='z'&&s[i+1]=='e'&&s[i+2]=='r'&&s[i+3]=='o') { printf("0"); } if(s[i]=='t'&&s[i+1]=='w'&&s[i+2]=='o') { printf("2"); } if(s[i]=='f'&&s[i+1]=='o'&&s[i+2]=='u'&&s[i+3]=='r') { printf("4"); } if(s[i]=='s'&&s[i+1]=='i'&&s[i+2]=='x') { printf("6"); } if(s[i]=='n'&&s[i+1]=='i'&&s[i+2]=='n'&&s[i+3]=='e') { printf("9"); } } printf(" "); } return 0; }