用visual studio跑都沒問題的說...
#include <iostream>
#include <string>
#include<cmath>
using namespace std;
int main() {
long int a,old=0,o=0,count=0;
string box[9999];
while(cin>>a){
for(int i=0;i<a;i++){
cin>>box[i];
}
for(int i=0;i<a;i++){
for(int j=0;j<i;j++){
if(box[i]==box[j]){
old=1;
break;
o=j;
}
}if(old==1){
cout<<"Old! "<<o+1<<endl;
old=0;
}else{
cout<<"New! "<<i+1<<endl;
}
}
}return 0;
}