모바일 오유 바로가기
http://m.todayhumor.co.kr
분류 게시판
베스트
  • 베스트오브베스트
  • 베스트
  • 오늘의베스트
  • 유머
  • 유머자료
  • 유머글
  • 이야기
  • 자유
  • 고민
  • 연애
  • 결혼생활
  • 좋은글
  • 자랑
  • 공포
  • 멘붕
  • 사이다
  • 군대
  • 밀리터리
  • 미스터리
  • 술한잔
  • 오늘있잖아요
  • 투표인증
  • 새해
  • 이슈
  • 시사
  • 시사아카이브
  • 사회면
  • 사건사고
  • 생활
  • 패션
  • 패션착샷
  • 아동패션착샷
  • 뷰티
  • 인테리어
  • DIY
  • 요리
  • 커피&차
  • 육아
  • 법률
  • 동물
  • 지식
  • 취업정보
  • 식물
  • 다이어트
  • 의료
  • 영어
  • 맛집
  • 추천사이트
  • 해외직구
  • 취미
  • 사진
  • 사진강좌
  • 카메라
  • 만화
  • 애니메이션
  • 포니
  • 자전거
  • 자동차
  • 여행
  • 바이크
  • 민물낚시
  • 바다낚시
  • 장난감
  • 그림판
  • 학술
  • 경제
  • 역사
  • 예술
  • 과학
  • 철학
  • 심리학
  • 방송연예
  • 연예
  • 음악
  • 음악찾기
  • 악기
  • 음향기기
  • 영화
  • 다큐멘터리
  • 국내드라마
  • 해외드라마
  • 예능
  • 팟케스트
  • 방송프로그램
  • 무한도전
  • 더지니어스
  • 개그콘서트
  • 런닝맨
  • 나가수
  • 디지털
  • 컴퓨터
  • 프로그래머
  • IT
  • 안티바이러스
  • 애플
  • 안드로이드
  • 스마트폰
  • 윈도우폰
  • 심비안
  • 스포츠
  • 스포츠
  • 축구
  • 야구
  • 농구
  • 바둑
  • 야구팀
  • 삼성
  • 두산
  • NC
  • 넥센
  • 한화
  • SK
  • 기아
  • 롯데
  • LG
  • KT
  • 메이저리그
  • 일본프로야구리그
  • 게임1
  • 플래시게임
  • 게임토론방
  • 엑스박스
  • 플레이스테이션
  • 닌텐도
  • 모바일게임
  • 게임2
  • 던전앤파이터
  • 마비노기
  • 마비노기영웅전
  • 하스스톤
  • 히어로즈오브더스톰
  • gta5
  • 디아블로
  • 디아블로2
  • 피파온라인2
  • 피파온라인3
  • 워크래프트
  • 월드오브워크래프트
  • 밀리언아서
  • 월드오브탱크
  • 블레이드앤소울
  • 검은사막
  • 스타크래프트
  • 스타크래프트2
  • 베틀필드3
  • 마인크래프트
  • 데이즈
  • 문명
  • 서든어택
  • 테라
  • 아이온
  • 심시티5
  • 프리스타일풋볼
  • 스페셜포스
  • 사이퍼즈
  • 도타2
  • 메이플스토리1
  • 메이플스토리2
  • 오버워치
  • 오버워치그룹모집
  • 포켓몬고
  • 파이널판타지14
  • 배틀그라운드
  • 기타
  • 종교
  • 단어장
  • 자료창고
  • 운영
  • 공지사항
  • 오유운영
  • 게시판신청
  • 보류
  • 임시게시판
  • 메르스
  • 세월호
  • 원전사고
  • 2016리오올림픽
  • 2018평창올림픽
  • 코로나19
  • 2020도쿄올림픽
  • 게시판찾기
  • 오유인페이지
    개인차단 상태
    지포군님의
    개인페이지입니다
    가입 : 14-09-27
    방문 : 1076회
    닉네임변경 이력
    회원차단
    회원차단해제
    게시물ID : programmer_8947
    작성자 : 지포군
    추천 : 0
    조회수 : 1305
    IP : 118.37.***.6
    댓글 : 5개
    등록시간 : 2015/03/28 00:07:14
    http://todayhumor.com/?programmer_8947 모바일
    C언어 구문오류 질문드립니다!
    옵션
    • 본인삭제금지
    <div>일단 본삭금</div> <div> </div><pre style="margin:0px;line-height:125%;"><span style="color:rgb(136,136,136);">#include <stdio.h></span> <span style="color:rgb(51,51,51);">//</span><span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">탑에</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">몇개의</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">원판이</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">있는지</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">변수</span><span style="color:rgb(0,112,32);">int</span> nplates[<span style="color:rgb(0,0,221);font-weight:bold;">3</span>]; <span style="color:rgb(51,51,51);">//</span><span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">어떤</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">원판이</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">있는지</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">보관</span><span style="color:rgb(51,51,51);">//</span><span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">탑의</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">현재</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">상태를</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">표시</span><span style="color:rgb(0,112,32);">int</span> tower[<span style="color:rgb(0,0,221);font-weight:bold;">3</span>][<span style="color:rgb(0,0,221);font-weight:bold;">100</span>]; void print_tower() { <span style="color:rgb(0,112,32);">int</span> i; <span style="color:rgb(51,51,51);">//</span>tower[][] <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">내용을</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">보여준다</span> A B C <span style="color:rgb(0,136,0);font-weight:bold;">for</span> (i <span style="color:rgb(51,51,51);">=</span> <span style="color:rgb(0,0,221);font-weight:bold;">1</span>; i <span style="color:rgb(51,51,51);"><</span> <span style="color:rgb(0,0,221);font-weight:bold;">5</span>; i<span style="color:rgb(51,51,51);">++</span>){ <span style="color:rgb(0,136,0);font-weight:bold;">if</span> (i <span style="color:rgb(51,51,51);">==</span> <span style="color:rgb(0,0,221);font-weight:bold;">1</span>) printf(<span style="background-color:rgb(255,240,240);">"</span><span style="color:rgb(102,102,102);font-weight:bold;background-color:rgb(255,240,240);">\n</span><span style="background-color:rgb(255,240,240);">A :"</span>); printf(<span style="background-color:rgb(255,240,240);">"</span><span style="background-color:rgb(238,238,238);">%d</span><span style="background-color:rgb(255,240,240);"> "</span>, tower[<span style="color:rgb(0,0,221);font-weight:bold;">0</span>][i]); } <span style="color:rgb(0,136,0);font-weight:bold;">for</span> (i <span style="color:rgb(51,51,51);">=</span> <span style="color:rgb(0,0,221);font-weight:bold;">1</span>; i <span style="color:rgb(51,51,51);"><</span> <span style="color:rgb(0,0,221);font-weight:bold;">5</span>; i<span style="color:rgb(51,51,51);">++</span>){ <span style="color:rgb(0,136,0);font-weight:bold;">if</span> (i <span style="color:rgb(51,51,51);">==</span> <span style="color:rgb(0,0,221);font-weight:bold;">1</span>) printf(<span style="background-color:rgb(255,240,240);">"</span><span style="color:rgb(102,102,102);font-weight:bold;background-color:rgb(255,240,240);">\n</span><span style="background-color:rgb(255,240,240);">B :"</span>); printf(<span style="background-color:rgb(255,240,240);">"</span><span style="background-color:rgb(238,238,238);">%d</span><span style="background-color:rgb(255,240,240);"> "</span>, tower[<span style="color:rgb(0,0,221);font-weight:bold;">1</span>][i]); } <span style="color:rgb(0,136,0);font-weight:bold;">for</span> (i <span style="color:rgb(51,51,51);">=</span> <span style="color:rgb(0,0,221);font-weight:bold;">1</span>; i <span style="color:rgb(51,51,51);"><</span> <span style="color:rgb(0,0,221);font-weight:bold;">5</span>; i<span style="color:rgb(51,51,51);">++</span>){ <span style="color:rgb(0,136,0);font-weight:bold;">if</span> (i <span style="color:rgb(51,51,51);">==</span> <span style="color:rgb(0,0,221);font-weight:bold;">1</span>) printf(<span style="background-color:rgb(255,240,240);">"</span><span style="color:rgb(102,102,102);font-weight:bold;background-color:rgb(255,240,240);">\n</span><span style="background-color:rgb(255,240,240);">C :"</span>); printf(<span style="background-color:rgb(255,240,240);">"</span><span style="background-color:rgb(238,238,238);">%d</span><span style="background-color:rgb(255,240,240);"> "</span>, tower[<span style="color:rgb(0,0,221);font-weight:bold;">2</span>][i]); } <span style="color:rgb(51,51,51);">//</span> <span style="color:rgb(51,51,51);">...</span> printf(<span style="background-color:rgb(255,240,240);">"</span><span style="color:rgb(102,102,102);font-weight:bold;background-color:rgb(255,240,240);">\n</span><span style="background-color:rgb(255,240,240);">"</span>); printf(<span style="background-color:rgb(255,240,240);">"다음 Enter : "</span>); getchar(); <span style="color:rgb(51,51,51);">//</span><span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">아무키나</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">누를때까지</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">대기</span> fflush(stdin); } <span style="color:rgb(51,51,51);">//</span><span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">하나의</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">원판을</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">이동할</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">때</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">마다</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">전체</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">탑의</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">현재</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">상태를</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">변경하고</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">탑의</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">내용을</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">표시</span><span style="color:rgb(51,51,51);">.</span>void move_one(<span style="color:rgb(0,112,32);">int</span> n, char from, char to)<span style="color:rgb(51,51,51);">//</span> n<span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">번</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">원판을</span> from<span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">에서</span> to<span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">로</span> { <span style="color:rgb(51,51,51);">//</span>nplates[](<span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">원판개수</span>) <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">와</span> tower[][] <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">내용을</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">수정한다</span> printf(<span style="background-color:rgb(255,240,240);">"</span><span style="color:rgb(102,102,102);font-weight:bold;background-color:rgb(255,240,240);">\n</span><span style="background-color:rgb(255,240,240);">원판 </span><span style="background-color:rgb(238,238,238);">%d</span><span style="background-color:rgb(255,240,240);">을 </span><span style="background-color:rgb(238,238,238);">%c</span><span style="background-color:rgb(255,240,240);">로 옮긴다.</span><span style="color:rgb(102,102,102);font-weight:bold;background-color:rgb(255,240,240);">\n</span><span style="background-color:rgb(255,240,240);">"</span>, n, from, to); tower[to][nplates[to] <span style="color:rgb(51,51,51);">+</span> <span style="color:rgb(0,0,221);font-weight:bold;">1</span>] <span style="color:rgb(51,51,51);">=</span> tower[from][nplates[from]]; <span style="color:rgb(51,51,51);">//</span>from<span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">에서</span> to<span style="color:rgb(51,51,51);">+</span><span style="color:rgb(0,0,221);font-weight:bold;">1</span><span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">로</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">값보내기</span> tower[from][nplates[from]] <span style="color:rgb(51,51,51);">=</span> <span style="color:rgb(0,0,221);font-weight:bold;">0</span>;<span style="color:rgb(51,51,51);">//</span><span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">보냈던</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">값을</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">지워주기</span> <span style="color:rgb(51,51,51);">//</span><span style="color:rgb(0,136,0);font-weight:bold;">from</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">에서는</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">제일</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">위의</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">원판을</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">빼고</span> <span style="color:rgb(51,51,51);">//</span>to <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">에서는</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">제일</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">끝의</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">원판을</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">추가하고</span> <span style="color:rgb(51,51,51);">//</span>nplates[]<span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">값을</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">감소</span><span style="color:rgb(51,51,51);">/</span><span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">증가</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">한다</span><span style="color:rgb(51,51,51);">.</span> nplates[from] <span style="color:rgb(51,51,51);">-=</span> <span style="color:rgb(0,0,221);font-weight:bold;">1</span>; nplates[to] <span style="color:rgb(51,51,51);">+=</span> <span style="color:rgb(0,0,221);font-weight:bold;">1</span>; <span style="color:rgb(51,51,51);">//</span><span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">이동이</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">발생할</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">때</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">마다</span> print_tower()<span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">호출</span> print_tower(); } <span style="color:rgb(51,51,51);">//</span><span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">타워내용을</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">초기화</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">한다</span><span style="color:rgb(51,51,51);">.</span> <span style="color:rgb(51,51,51);">//</span>start <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">위치에</span> n<span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">개의</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">원판</span>(<span style="color:rgb(0,0,221);font-weight:bold;">1</span><span style="color:rgb(51,51,51);">~</span>n)<span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">이</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">있다</span><span style="color:rgb(51,51,51);">.</span>void init_tower(<span style="color:rgb(0,112,32);">int</span> n, char start) { <span style="color:rgb(0,112,32);">int</span> i, tower_no; <span style="color:rgb(51,51,51);">//</span><span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">탑의</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">번호</span> A,B,C <span style="color:rgb(51,51,51);">-></span> <span style="color:rgb(0,0,221);font-weight:bold;">0</span>,<span style="color:rgb(0,0,221);font-weight:bold;">1</span>,<span style="color:rgb(0,0,221);font-weight:bold;">2</span> tower_no <span style="color:rgb(51,51,51);">=</span> start <span style="color:rgb(51,51,51);">-</span> <span style="background-color:rgb(255,240,240);">'A'</span>; <span style="color:rgb(51,51,51);">//</span>tower[][]<span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">내용과</span> nplates[]<span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">를</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">초기화한다</span><span style="color:rgb(51,51,51);">.</span> tower[<span style="color:rgb(0,0,221);font-weight:bold;">3</span>][<span style="color:rgb(0,0,221);font-weight:bold;">100</span>] <span style="color:rgb(51,51,51);">=</span> {<span style="color:rgb(0,0,221);font-weight:bold;">0</span>};<span style="color:rgb(51,51,51);">//</span> <span style="color:rgb(51,51,51);">-----------------------------</span> <span style="color:rgb(51,51,51);">></span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">구문오류</span> nplates[<span style="color:rgb(0,0,221);font-weight:bold;">3</span>] <span style="color:rgb(51,51,51);">=</span> {<span style="color:rgb(0,0,221);font-weight:bold;">0</span>};<span style="color:rgb(51,51,51);">//</span> <span style="color:rgb(51,51,51);">--------------------------------</span> <span style="color:rgb(51,51,51);">></span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">구문오류</span> <span style="color:rgb(51,51,51);">//</span>tower[<span style="color:rgb(0,0,221);font-weight:bold;">0</span>][<span style="color:rgb(0,0,221);font-weight:bold;">0</span>]<span style="color:rgb(51,51,51);">~</span>[<span style="color:rgb(0,0,221);font-weight:bold;">0</span>][<span style="color:rgb(0,0,221);font-weight:bold;">3</span>] <span style="color:rgb(51,51,51);">=</span> <span style="color:rgb(0,0,221);font-weight:bold;">4</span>,<span style="color:rgb(0,0,221);font-weight:bold;">3</span>,<span style="color:rgb(0,0,221);font-weight:bold;">2</span>,<span style="color:rgb(0,0,221);font-weight:bold;">1</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">식으로</span> <span style="color:rgb(0,136,0);font-weight:bold;">for</span> (i <span style="color:rgb(51,51,51);">=</span> <span style="color:rgb(0,0,221);font-weight:bold;">1</span>; i <span style="color:rgb(51,51,51);"><=</span> n; i<span style="color:rgb(51,51,51);">++</span>) tower[tower_no][i] <span style="color:rgb(51,51,51);">=</span> i; <span style="color:rgb(51,51,51);">//</span>nplates[] <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">에</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">원판의</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">수를</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">기억시킨다</span><span style="color:rgb(51,51,51);">.</span> nplates[tower_no] <span style="color:rgb(51,51,51);">=</span> <span style="color:rgb(0,0,221);font-weight:bold;">0</span>; } void hanoi_tower(<span style="color:rgb(0,112,32);">int</span> n, char from, char tmp, char to) { <span style="color:rgb(0,136,0);font-weight:bold;">if</span> (n <span style="color:rgb(51,51,51);">==</span> <span style="color:rgb(0,0,221);font-weight:bold;">1</span>) <span style="color:rgb(51,51,51);">//</span><span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">제일</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">위에</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">있는</span> <span style="color:rgb(0,0,221);font-weight:bold;">1</span><span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">번</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">원판을</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">이동</span> move_one(<span style="color:rgb(0,0,221);font-weight:bold;">1</span>, from, to); <span style="color:rgb(0,136,0);font-weight:bold;">else</span> { <span style="color:rgb(51,51,51);">//</span><span style="color:rgb(0,0,221);font-weight:bold;">1</span><span style="color:rgb(51,51,51);">~</span>n<span style="color:rgb(51,51,51);">-</span><span style="color:rgb(0,0,221);font-weight:bold;">1</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">을</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">임시</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">장소에</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">이동</span> hanoi_tower(n <span style="color:rgb(51,51,51);">-</span> <span style="color:rgb(0,0,221);font-weight:bold;">1</span>, from, to, tmp); <span style="color:rgb(51,51,51);">//</span><span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">제일</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">밑에</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">있는</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">원판을</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">이동</span> move_one(n, from, to); <span style="color:rgb(51,51,51);">//</span><span style="color:rgb(0,0,221);font-weight:bold;">1</span> <span style="color:rgb(51,51,51);">~</span> n<span style="color:rgb(51,51,51);">-</span><span style="color:rgb(0,0,221);font-weight:bold;">1</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">을</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">임시</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">장소에서</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">목적지로</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">이동</span> hanoi_tower(n <span style="color:rgb(51,51,51);">-</span> <span style="color:rgb(0,0,221);font-weight:bold;">1</span>, tmp, from, to); } } void main() { <span style="color:rgb(51,51,51);">//</span><span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">초기</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">조건</span>, <span style="color:rgb(0,0,221);font-weight:bold;">1</span><span style="color:rgb(51,51,51);">~</span><span style="color:rgb(0,0,221);font-weight:bold;">4</span><span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">원판이</span> A<span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">에</span> <span style="color:rgb(255,0,0);background-color:rgb(255,170,170);">있다</span><span style="color:rgb(51,51,51);">.</span> init_tower(<span style="color:rgb(0,0,221);font-weight:bold;">4</span>, <span style="background-color:rgb(255,240,240);">'A'</span>); printf(<span style="background-color:rgb(255,240,240);">"초기상태"</span>); print_tower(); hanoi_tower(<span style="color:rgb(0,0,221);font-weight:bold;">4</span>, <span style="background-color:rgb(255,240,240);">'A'</span>, <span style="background-color:rgb(255,240,240);">'B'</span>, <span style="background-color:rgb(255,240,240);">'C'</span>); }</pre><pre style="margin:0px;line-height:125%;"> </pre><pre style="margin:0px;line-height:125%;">코드는 이것이구요</pre><pre style="margin:0px;line-height:125%;">하노이타워를 실시간으로 알려주는 프로그램입니다.</pre><pre style="margin:0px;line-height:125%;">어디로 보내고 또 어디로 갔는지..</pre><pre style="margin:0px;line-height:125%;">근데 중간까지는 괜찮았는데 저기 void init_tower(<span style="color:rgb(0,112,32);">int</span> n, char start) 부분에서 구문오류가 나네요,,</pre><pre style="margin:0px;line-height:125%;">전 배열을 초기화 해주고 싶었는데 그게 안됩니다.,.. x[100] = {0,} 이런식으로 썻는데 안되요...</pre><pre style="margin:0px;line-height:125%;">제가 전역에 두고 해서 그런간가요 ㅠㅠ 지금 이게 막혀서 테스트도 못하고있습니다... </pre>

    이 게시물을 추천한 분들의 목록입니다.
    푸르딩딩:추천수 3이상 댓글은 배경색이 바뀝니다.
    (단,비공감수가 추천수의 1/3 초과시 해당없음)

    죄송합니다. 댓글 작성은 회원만 가능합니다.

    번호 제 목 이름 날짜 조회 추천
    82
    흙흙 4차 릴레이 당첨자분 보세요! [6] 지포군 15/04/04 20:08 69 1
    81
    C언어에서 문자를 하나씩 분석하는것 질문 있습니다! [2] 지포군 15/04/04 16:03 49 0
    80
    개발자 여러분들은 노트북 뭐 쓰시나요?? [12] 지포군 15/04/04 14:05 67 0
    79
    교통사고시에 가장 적은 피해를 받는법?? [3] 지포군 15/04/04 09:49 81 0
    78
    4회차 릴레이 나눔 결과! [2] 지포군 15/04/03 23:17 55 2
    77
    C언어 문자열 거르는거 질문있습니다. [10] 지포군 15/04/03 12:37 52 0
    76
    C언어 질문이 있습니다. (C파일 나눠서 하기) [4] 지포군 15/04/02 20:55 38 0
    75
    닉언죄)커플암살자님 3회차 릴레이 나눔 인증~ [6] 지포군 15/04/02 11:30 68 4
    74
    SSH로 C컴파일& 실행하기 질문있습니다~~ [5] 지포군 15/04/01 19:41 29 0
    73
    C언어에서 파일 이용해서 정수 받아오는거 질문이요! [7] 지포군 15/04/01 17:12 46 0
    72
    카스글옵 ... 온라인은 어딜가나 똑같군요.. [5] 지포군 15/03/30 16:12 135 0
    71
    마앤블 파앤소 하는데 계속 튕기네요.. [3] 지포군 15/03/29 23:16 68 0
    70
    카스글옵 위에 뜨는 선물은 뭔가요? [1] 지포군 15/03/28 00:25 54 0
    C언어 구문오류 질문드립니다! [7] 지포군 15/03/28 00:07 31 0
    68
    흐어어어 지금 사퍼 못해서 미치겠습니다 ㅠㅠ [3] 지포군 15/03/27 13:11 118 1
    67
    C언어 리턴 질문입니다. [9] 지포군 15/03/27 12:03 74 0
    66
    복돌로 했던 게임들 이번에 구입했어요! [5] 지포군 15/03/27 11:39 236 8
    65
    사퍼를 못한지 3주가 다되갑니다. [1] 지포군 15/03/25 23:06 39 0
    64
    지금 사탕 누구줄지 고민중 [14] 지포군 15/03/24 14:58 68 2
    63
    바쇽 시즌패스 구성이 [4] 지포군 15/03/23 12:10 96 0
    62
    포그 뭐살지 고민중... [6] 지포군 15/03/23 10:24 95 0
    61
    글옵 경쟁 하는데 꿀잼이네요 지포군 15/03/22 22:08 47 0
    60
    (본삭금)사퍼 오류로 문의 보내시는분들 작은 팁 드릴게요 [2] 지포군 15/03/20 23:12 62 1
    59
    본삭금) C언어 Time관련 질문있습니다. [7] 지포군 15/03/20 12:03 49 0
    58
    내 손아 왜그랬어 ㅠㅠ [2] 지포군 15/03/20 10:14 214 3
    57
    닉언죄) 사회복지학과님 봉선엣지 나눔인증! [2] 지포군 15/03/19 22:24 46 2
    56
    갑자기 생각난건데 수업을 들으면 왜 졸릴까요 [2] 지포군 15/03/19 21:17 46 0
    55
    혹시 저처럼 제키엘 업데이트 후에 사이퍼즈 계속 튕시기는분 있나요? [7] 지포군 15/03/18 10:40 58 1
    54
    뭐지.. OTP때문에 사퍼가 안됬었던것 같아요 [2] 지포군 15/03/16 22:03 48 0
    53
    으으 페데2 한패했더니 안켜지네요 ㅠㅠ [11] 지포군 15/03/16 21:59 97 0
    [1] [2] [3] [4] [5] [6] [7] [8]
    단축키 운영진에게 바란다(삭제요청/제안) 운영게 게시판신청 자료창고 보류 개인정보취급방침 청소년보호정책 모바일홈