~cpp // no10188 - Automated Judge Script #include <iostream> #include <cstring> using namespace std; const int MAX = 100; bool setString(char * s, char * sDigit); int main() { char answer[MAX*MAX]; // 정답 char answerDigit[MAX]; char reply[MAX*MAX]; // 사용자 출력 char replyDigit[MAX]; int count = 1; while (true) { if (!setString(answer, answerDigit) || !setString(reply, replyDigit)) break; cout << "Run #" << count++; if (strcmp(answerDigit, replyDigit) != 0) cout << ": Wrong Answer\n"; else if (strcmp(answer, reply) == 0) cout << ": Accepted\n"; else cout << ": Presentation Error\n"; } return 0; } bool setString(char * s, char * sDigit) { int n; cin >> n; if (n == 0) return false; cin.get(); int nDigit, nChar, nReturn; nDigit = nChar = nReturn = 0; char c; while (true) { c = cin.get(); if (c == '\n') nReturn++; if (nReturn == n) break; if (c >= '0' && c <= '9') sDigit[nDigit++] = c; s[nChar++] = c; } sDigit[nDigit] = '\0'; s[nChar] = '\0'; return true; }