Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- int suit[4], rank[4], i = 0, j = 0;
- char S, C, D, H;
- srand((unsigned)time(0));
- for( i; i < 4; i++ )
- {
- suit[i] = (rand()%4)+1;
- rank[i] = (rand()%13)+1;
- }
- /*for( i = 0; i < 4; i++ )
- {
- if( suit[i] == 1 )
- suit[i] = S;
- if( suit[i] == 2 )
- suit[i] = C;
- if( suit[i] == 3 )
- suit[i] = D;
- if( suit[i] == 4 )
- suit[i] = H;
- }
- */
- if( suit[0] == 1 || suit[0] == 2 || suit[0] == 3 || suit[0] == 4 )
- printf("1. %d of %d", rank[0], suit[0]);
- getch();
- }
Add Comment
Please, Sign In to add comment