online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <stdio.h> // ν‘œμ€€ μž…μΆœλ ₯ κ΄€λ ¨ κΈ°λŠ₯을 μ œκ³΅ν•˜λŠ” 헀더 파일일 #include <stdlib.h> // ν‘œμ€€ 라이브러리 ν•¨μˆ˜μˆ˜ #include <time.h> // λ‚ μ§œμ™€ μ‹œκ°„ κ΄€λ ¨ κΈ°λŠ₯을 μ œκ³΅ν•˜λŠ” 헀더 파일일 #pragma warning(disable:4996) 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; } } μœ„ whileλ¬Έ μ‚¬μš© μ‹œ μ•„λž˜ λ¬Έμž₯ λΉΌκΈ° do { userGuess = getUserGuess(); */ do { userGuess = getUserGuess(); diceResult = throwDice(); printf("μ£Όμ‚¬μœ„ κ²°κ³Ό: %d\n", diceResult); if (userGuess == diceResult) { printf("μΆ•ν•˜ν•©λ‹ˆλ‹€! 숫자λ₯Ό λ§žν˜”μŠ΅λ‹ˆλ‹€. \n"); } else { printf("μ•„μ‰½μŠ΅λ‹ˆλ‹€. λ‹€μ‹œ μ‹œλ„ν•˜μ„Έμš”.\n"); } } while (userGuess != 0); } 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