Two-color balls written in C language and two-color balls written in C Language
# Include <stdio. h>
# Include <stdlib. h>
# Include <time. h>
Double jieguo ();
Void main (){
Int I, k;
Int m, n;
Int j;
Printf ("Enter the purchased number: \ n ");
Scanf ("% d", & I );
J = jieguo ();
If (I = j)
Printf ("the winning amount is 500 RMB \ n ");
If (I % 100 = j % 100)
Printf ("the winning amount is 150 RMB \ n ");
For (m = 1; m <= 5; m ++ ){
I = I % 100;
For (k = 1, n = 0; k <= 5; k ++ ){
J = j % 100;
If (I = j)
N = n + 1;
}
}
Printf ("% d \ n", n );
If (n = 5 & j % 100 = I % 100)
Printf ("the prize is 3000 \ n ");
If (n = 5 & j % 100! = I % 100) | (n = 4 & j % 100 = I % 100 ))
Printf ("the prize is 200 \ n ");
If (n = 4 & j % 100! = I % 100) | (n = 3 & j % 100 = I % 100 ))
Printf ("the reward is 10 \ n ");
If (n = 2 & j % 100 = I % 100) | (n = 1 & j % 100 = I % 100) | (n = 0 & j % 100 = I % 100 ))
Printf ("5 \ n ");
}
Double jieguo (){
Int a, B;
Int I;
Double sum;
Srand (time (NULL ));
For (I = 1, sum = 0; I <= 6; I ++ ){
A = rand () % 37;
// Printf ("% d \ n", );
Sum = sum * 100;
Sum + =;
}
B = rand () % 17;
Sum = sum * 100 + B;
Return sum;
}