/* 3. ´ÙÀ½ ÇÁ·Î±×·¥ÀÇ Ãâ·ÂÀ» ½á¶ó. */ #include main() { int a; int b; int x,y,z; int i; printf("a ? "); scanf("%d",&a); printf("b ? "); scanf("%d",&b); x = 0; y = 0; z = 0; srand(a+b); for(i = 0; i < 1000000; i++) { x = (int)rand(); if (x/2*2 == x) { y = y + 1; } else { z = z + 1; } } if (y >= z) { x = y; } else { x = z; } x = x / 10000; printf("result = %d percent\n",x); }