#include #define NIL (0) class Cell { public: int x; int y; Cell() { x = 0; y = 0; } void setCell(int i) { x = i; y = 10 - i; } int getCell() { return x+y; } }; class Cells { public: Cell data[5]; Cells(int x[]) { for (int i = 0; i < 5; i++) { data[i].setCell(x[i]); } } int getCells() { int val = 0; for (int i = 0; i < 5; i++) { val = val + data[i].getCell(); } return val; } }; void main() { int key[5] = { 0, 1, 2, 3, 4 }; // key °ª ´ëÄ¡ Cells what(key); printf("answer = %d\n",what.getCells()); }