d517.
文字抄寫 I
| From: [65.49.2.15] |
發表日期
:
2010-12-07 14:09
#include <iostream>
using namespace std;
int main(){
char ch[4];
int inputs;
while(scanf("%d", &inputs)==1){
int ser[26][26][26][26]={0}, count=0;
for(int a=0; a<inputs; ++a){
scanf("%s", ch);
if(ser[ch[0]-'a'][ch[1]-'a'][ch[2]-'a'][ch[3]-'a'])
printf("Old! %d\n", ser[ch[0]-'a'][ch[1]-'a'][ch[2]-'a'][ch[3]-'a']);
else{
ser[ch[0]-'a'][ch[1]-'a'][ch[2]-'a'][ch[3]-'a']=++count;
printf("New! %d\n", count);
}
}
delete[] ser;
}
// system("pause");
return 0;
}