online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#pragma warning(disable:4996) #include <stdio.h> #include <stdlib.h> #include <time.h> int throwdice(); int getuserguess(); void playguessinggame(); int throwdice(){ return rand() % 6 + 1; } int getuserguess(){ int guess; printf("주사위를 던져 나올 숫자를 맞혀보세요 (1에서 6까지): "); scanf("%d", &guess); return guess; } void playguessinggame(){ int userguess, diceresult; while(1){ userguess = getuserguess(); if (userguess == 0){ printf("게임을 종료합니다.\n"); break; } else if (userguess < 1 || userguess > 6){ printf("잘못된 값을 입력하셨습니다.\n"); continue; } diceresult = throwdice(); printf("주사위 결과: %d\n", diceresult); if (userguess == diceresult){ printf("축하합니다! 숫자를 맞췄습니다.\n"); } else { printf("아쉽습니다. 다시 시도하세요.\n"); } } } int main() { srand(time(NULL)); printf("주사위 숫자 맞히기 게임을 시작합니다.\n"); playguessinggame(); printf("게임 종료\n"); return 0; }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue