{"id":41235,"date":"2026-05-23T09:00:35","date_gmt":"2026-05-23T00:00:35","guid":{"rendered":"https:\/\/blog.agentsoft.co.kr\/index.php\/2026\/05\/23\/41235\/"},"modified":"2026-05-23T09:00:35","modified_gmt":"2026-05-23T00:00:35","slug":"c-report-%ec%8a%a4%ed%83%9d-%ed%81%b4%eb%9e%98%ec%8a%a4-%ed%96%89%eb%a0%ac-%ed%81%b4%eb%9e%98%ec%8a%a4","status":"publish","type":"post","link":"https:\/\/blog.agentsoft.co.kr\/index.php\/2026\/05\/23\/41235\/","title":{"rendered":"C++ report \uc2a4\ud0dd \ud074\ub798\uc2a4, \ud589\ub82c \ud074\ub798\uc2a4"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/image4.happycampus.com\/Production\/thumbnail\/2024\/06\/13\/data29998929-0001.jpg\"><img decoding=\"async\" src=\"https:\/\/image4.happycampus.com\/Production\/thumbnail\/2024\/06\/13\/data29998929-0002.jpg\"><\/p>\n<p><strong>\ubaa9\ucc28<\/strong><\/p>\n<p>\uc5c6\uc74c<\/p>\n<p><strong>\ubcf8\ubb38\ub0b4\uc6a9<\/strong><\/p>\n<p>3. \uc2a4\ud0dd \ud074\ub798\uc2a4 \uc120\uc5b8 \ubc0f \uc815\uc758<\/p>\n<p>\/\/ **** file: stack.h<\/p>\n<p>#include <iostream><br \/>\nusing namespace std;<\/p>\n<p>class Stack {<br \/>\npublic:<br \/>\n   enum { MaxStack = 5 };<br \/>\n   void init() { top = -1; }<br \/>\n   void push( int n ) {<br \/>\n      if ( isFull() ) {<br \/>\n         errMsg( &#8220;Full stack.  Can&#8217;t push.&#8221; );<br \/>\n         return;<br \/>\n      }<br \/>\n      arr[ ++top ] = n;<br \/>\n   }<br \/>\n    int pop() {<br \/>\n      if ( isEmpty() ) {<br \/>\n         errMsg( &#8220;Empty stack.  Popping dummy value.&#8221; );<br \/>\n         return dummy_val;<br \/>\n      }<br \/>\n      return arr[ top&#8211; ];<br \/>\n   }<br \/>\n   bool isEmpty() { return top < 0; }\n   bool isFull()  { return top >= MaxStack &#8211; 1; }<br \/>\n   void dump() {<br \/>\n      cout << \"Stack contents, top to bottom:\\n\";\n      for ( int i = top; i >= 0; i&#8211; )<br \/>\n         cout << '\\t' << arr[ i ] << '\\n';\n   }\n\nprivate:\n   void errMsg( const char* msg ) const {\n      cerr << \"\\n*** Stack operation failure: \" << msg << '\\n';\n   }\n   int top;\n   int arr[ MaxStack ];\n   int dummy_val;\n\n};\n\n4. \uc218\ud589 \ud504\ub85c\uadf8\ub7a8\n\n    \/\/**** file: stack.cpp\n\n #include \"stack.h\" \/\/ header for Stack class\n\n<br \/>\ucd9c\ucc98 : <a href=\"https:\/\/www.happycampus.com\/report-doc\/29998929\/\" target=\"_blank\">\ud574\ud53c\ucea0\ud37c\uc2a4<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\ubaa9\ucc28 \uc5c6\uc74c \ubcf8\ubb38\ub0b4\uc6a9 3. \uc2a4\ud0dd \ud074\ub798\uc2a4 \uc120\uc5b8 \ubc0f \uc815\uc758 \/\/ **** file: stack.h #include using namespace std; class Stack { public: enum { MaxStack = 5 }; void init() { top = -1; } void push( int n ) { if ( isFull() ) { errMsg( &#8220;Full stack. Can&#8217;t push.&#8221; ); return; } arr[ ++top [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[28192,36900,51738,51741,51742,51743],"class_list":["post-41235","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-4--","tag-a--n-x-n--","tag-c","tag-51741","tag-51742","tag-51743"],"_links":{"self":[{"href":"https:\/\/blog.agentsoft.co.kr\/index.php\/wp-json\/wp\/v2\/posts\/41235","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.agentsoft.co.kr\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.agentsoft.co.kr\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.agentsoft.co.kr\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.agentsoft.co.kr\/index.php\/wp-json\/wp\/v2\/comments?post=41235"}],"version-history":[{"count":0,"href":"https:\/\/blog.agentsoft.co.kr\/index.php\/wp-json\/wp\/v2\/posts\/41235\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.agentsoft.co.kr\/index.php\/wp-json\/wp\/v2\/media?parent=41235"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.agentsoft.co.kr\/index.php\/wp-json\/wp\/v2\/categories?post=41235"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.agentsoft.co.kr\/index.php\/wp-json\/wp\/v2\/tags?post=41235"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}