作者:群-众-生-活 | 来源:互联网 | 2023-10-16 09:02
原题链接#include#include#include#includeusingnamespacestd;charbuf[100];char*digitToSt
原题链接
#include
#include
#include
#include
using namespace std;
char buf[100];
char *digitToString(int n){
sprintf(buf, "%d", n);
return buf;
}
int main(){
int n;
string str, temp;
set st;
cin >> n;
while(n--){
cin >> str;
if(st.count(str) == 0){
st.insert(str);
cout <<"OK" < }
else{
for(int i = 1; ; ++i){
temp = str;
if(st.count(temp.append(digitToString(i))) == 0){
st.insert(temp);
cout < break;
}
}
}
}
return 0;
}
801811 |
长木 |
Registration system |
Accepted |
0 |
308 |
C/C&#43;&#43; |
04-08 09:19:26 |
NYOJ991 Registration system 【set的用法】,布布扣,bubuko.com