~cpp #include <iostream> using namespace std; class String { int m_number; public: String(int input_number); String(); ~String(); int check(int check_number); }; String::String(int input_number) { m_number = input_number; cout << "클래스가 생성 되었습니다." << endl ; } String::String() { m_number = 0; } String::~String() { cout << m_number << "를 가진 클래스가 파괴 되었습니다." << endl ; } int String::check(int check_number) { if( m_number == check_number ) { return 1; } else { return 2; } } int main() { String *test[255]; int number; for( int i = 0; i < 255; i++) { cin >> number; int check2=0; int check_number[255] ; for (int a=0 ; a<255;a++) { check_number[a]=0; } if( number ==0 ) { for(int j = 0;j<i;j++) { delete test[j]; } return 0; } else { for(int k = 0; k< i ; k++) { check_number[k] = test[k]->check(number); } for(k=0 ; k<255 ; k++) { if(check_number[k] == 1) { delete test[k]; for(int l = k; k<i-1;k++) { test[k] = test[k+1]; } check2 = 1; i--; } } if(check2==0) { test[i] = new String(number); } } } return 0; }