게시판 즐겨찾기
편집
드래그 앤 드롭으로
즐겨찾기 아이콘 위치 수정이 가능합니다.
가위바위보게임에 이긴누적수를 넣고싶은데 어떻게 하면될까요
게시물ID : programmer_5019짧은주소 복사하기
작성자 : Riot_자크
추천 : 1
조회수 : 443회
댓글수 : 3개
등록시간 : 2014/08/15 21:28:31
옵션
  • 본인삭제금지
#include<stdio.h> #include <stdlib.h>  #include <time.h>    void main() {int input, computer; srand((int)time(NULL));  while(1) { printf("[가위바위보게임]\n 가위:0, 바위:1, 보:2\n 나:"); scanf("%d", &input);  if((input < 0) || (input > 3)) { printf("다시 입력해 주세요!\n\n"); continue; } if(input == 3) break;  computer = rand() % 3;  printf(" 컴퓨터:%d\n",computer);  if(computer == input) { printf("비겼습니다. \n\n"); } else if((computer == 0) && (input == 1)) { printf("이기셨습니다.\n\n"); } else if((computer == 0) && (input == 2)) { printf("지셨습니다.\n\n"); } else if((computer == 1) && (input == 2)) { printf("이기셨습니다.\n\n"); } else if((computer == 1) && (input == 0)) { printf("지셨습니다.\n\n"); } else if((computer == 2) && (input == 0)) { printf("이기셨습니다.\n\n"); } else if((computer == 2) && (input == 1)) { printf("지셨습니다.\n\n"); }   } }


누적이긴수 어떻게 설정할수있을까요 
전체 추천리스트 보기
새로운 댓글이 없습니다.
새로운 댓글 확인하기
글쓰기
◀뒤로가기
PC버전
맨위로▲
공지 운영 자료창고 청소년보호