/* °´Ã¼ ÁöÇâ ÇÁ·Î±×·¡¹Ö Áß°£ °í»ç Çйø : ¼º¸í : ´ÙÀ½ ÇÁ·Î±×·¥µéÀÇ Ãâ·ÂÀ» ½á¶ó. ÁÖÀÇ »çÇ× (1): ÁÖ°£ ¹®Á¦¿Í ¾ß°£ ¹®Á¦°¡ ´Ù¸£¹Ç·Î ÁÖ°£¿¡ ¼ö¾÷µè´Â ÇлýÀº ÁÖ°£ ¹®Á¦¸¦ Ç®°í ¾ß°£¿¡ µè´Â ÇлýÀº ¾ß°£ ¹®Á¦¸¦ Ç®°Í ÁÖÀÇ »çÇ× (2): ½ÃÇèÁö¿¡ Àý´ë·Î ³«¼­ÇÏÁö ¸»°Í ÁÖÀÇ »çÇ× (3): ¹®Á¦µéÀ» Ç® ¶§ ¸ðµç ÇÁ·Î±×·¥¿¡ ÀÖ´Â data º¯¼öÀÇ °ªÀ» ¾Æ·¡ °ªÀ¸·Î ´ëÄ¡ÇÑ ÈÄ¿¡ ¹®Á¦¸¦ Ç®°Í. int data[5] = { , , , , }; */ // ÁÖ°£¿ë 1¹ø ¹®Á¦ #include int what(int *x,int n) { *x = *x + 1; if (n == 1) return *x; int y = what(x+1,n-1); if (*x > y) return y; return *x; } void main() { int data[5] = { 0, 1, 2, 3, 4 }; printf("%d\n",what(data,5)); }