953, 1/48 ȸ¿ø°¡ÀÔ  ·Î±×ÀΠ 
   AaTrxx
   c¾ð¾î ±ÛÀÚ ÀÔ·Â ¿À·ù

http://www.hackerschool.org/HS_Boards/view.php?id=QNA_ETC&no=1141 [º¹»ç]


include <stdio.h>
#include <stdlib.h>
#include <time.h>

int main() {
        srand(time(NULL));
        int you = (rand() % 99) + 1;
        int computer = (rand() % 99) + 1;
        char yes;

        printf("´ç½ÅÀÇ À̸§À» Ä¡¼¼¿ä:");
        scanf("%c", &yes);
        printf("%cÀÇ ¼ýÀÚ:%d\n", yes, you);
        printf("ÄÄÇ»ÅÍÀÇ ¼ýÀÚ:%d\n", computer);
                if (you < computer) {
                        printf("ÄÄÇ»ÅÍ°¡ ½Â¸®Çß½À´Ï´Ù!");
                }
                else if (you > computer) {
                        printf("%c°¡ ÀÌ°å½À´Ï´Ù!", yes);
                }
        return 0;
}
¿©±â¼­ À̸§À» Ä¡¸é ÀÌ»óÇÏ°Ô ³ª¿Í¿ä

  Hit : 1857     Date : 2020/03/15 02:42



    
ekklesia74 ¾Æ·¡´Â ¼öÁ¤µÈ ¼Ò½ºÀÔ´Ï´Ù.
///////////////////////////////////////////////////////////////////////////////////////////////
#include <stdio.h>
#include <stdlib.h>
#include <time.h>

int main() {
srand(time(NULL));
int you = (rand() % 99) + 1;
int computer = (rand() % 99) + 1;
char yes[10];

printf("´ç½ÅÀÇ À̸§À» Ä¡¼¼¿ä:");
scanf("%s", yes);
printf("%sÀÇ ¼ýÀÚ:%d\n", yes, you);
printf("ÄÄÇ»ÅÍÀÇ ¼ýÀÚ:%d\n", computer);
if (you < computer) {
printf("ÄÄÇ»ÅÍ°¡ ½Â¸®Çß½À´Ï´Ù!");
}
else if (you > computer) {
printf("%s°¡ ÀÌ°å½À´Ï´Ù!", yes);
}
return 0;
}
/////////////////////////////////////////////////////////////////////////////////////////////////
À̸§Àº ¹®ÀÚ¿­ÀÌ¶ó ¹®ÀÚ ¹è¿­·Î ¹Þ¾Æ¾ß ÇÕ´Ï´Ù ¿©±â¼­´Â char yes[10]À¸·Î ¼±¾ð Çß½À´Ï´Ù.
±×¸®°í ¹®ÀÚ¿­À» ÀÔ·Â ¹Þ°Å³ª Ãâ·ÂÇÒ¶§´Â %c°¡ ¾Æ´Ï¶ó %sÀÔ´Ï´Ù. ¹è¿­ÀÇ À̸§ yes´Â ÁÖ¼Ò¸¦ °¡¸®Å°±â
¶§¹®¿¡ scanf("%s", &yes); ¿©±â¿¡¼­ ÁÖ¼Ò¸¦ ³ªÅ¸³»´Â &¸¦ ºÙÀÏ ÇÊ¿ä°¡ ¾ø½À´Ï´Ù scanf("%s", yes);¿Í°°ÀÌ ÄÚµùÇÏ¸é µË´Ï´Ù. À±¼º¿ìÀÇ "¿­Ç÷°­ÀÇ C"º¸¸é Àß ¾²¿© Á® ÀÖ½À´Ï´Ù
¿­°øÇϼż­ ÈÇ·æÇÑ ÇØÄ¿ µÇ½Ê½Ã¿ä ^^
2020/03/18  
todarinop1 À§¿¡ ¼Ò½ºÄÚµå Ʋ·È³×¿ä.
±³Á¤ÇϽ÷Á¸é ´Ù½Ã ¹è¿ì¼¼¿ä.
Åä´Ù¸®³ë´Ù.
2020/04/17  

Copyright 1999-2024 Zeroboard / skin by Hackerschool.org / Secure Patch by Hackerschool.org