1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | #define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <stdlib.h> int main(void) { int ans; printf("»ê¼ö ¹®Á¦¸¦ ÀÚµ¿À¸·Î ÃâÁ¦ÇÕ´Ï´Ù. \n"); while(1) { int x = rand() % 100; int y = rand() % 100; printf("%d + %d = ", x, y); scanf("%d", &ans); if (x + y == ans) { printf("¸Â¾Ò½À´Ï´Ù.\n"); break; } else printf("Ʋ·È½À´Ï´Ù.\n"); } return 0; } | cs |