fork download
  1. #include <stdio.h>
  2. #define static_size(p) (sizeof(p) / sizeof(*p))
  3. int main(void)
  4. {
  5. const char *const suit[] = {
  6. "clubs", "diamonds", "spades", "hearts"
  7. };
  8. const char *const rank[] = {
  9. "ace", "two", "three", "four", "five",
  10. "six", "seven", "eight", "nine", "ten",
  11. "jack", "queen", "king"
  12. };
  13. unsigned i, j;
  14. for (i = 0; i < static_size(suit); i++)
  15. for (j = 0; j < static_size(rank); j++)
  16. printf("%s of %s\n", rank[j], suit[i]);
  17. }
  18.  
Success #stdin #stdout 0s 9432KB
stdin
Standard input is empty
stdout
ace of clubs
two of clubs
three of clubs
four of clubs
five of clubs
six of clubs
seven of clubs
eight of clubs
nine of clubs
ten of clubs
jack of clubs
queen of clubs
king of clubs
ace of diamonds
two of diamonds
three of diamonds
four of diamonds
five of diamonds
six of diamonds
seven of diamonds
eight of diamonds
nine of diamonds
ten of diamonds
jack of diamonds
queen of diamonds
king of diamonds
ace of spades
two of spades
three of spades
four of spades
five of spades
six of spades
seven of spades
eight of spades
nine of spades
ten of spades
jack of spades
queen of spades
king of spades
ace of hearts
two of hearts
three of hearts
four of hearts
five of hearts
six of hearts
seven of hearts
eight of hearts
nine of hearts
ten of hearts
jack of hearts
queen of hearts
king of hearts