fork(14) download
  1. #include <stdio.h>
  2.  
  3. char msg[] = "15973 7591/ 7415963/";
  4.  
  5. int main(void) {
  6. const char* keypad[] = {
  7. " /*-",
  8. "789+",
  9. "456+",
  10. "123 ",
  11. "00. "
  12. };
  13. for (int row = 0; row < 5; row++) {
  14. char* start = msg;
  15. while (1) {
  16. char* end = strchr(start, ' ');
  17. if (end) *end = '\0';
  18. for (int col = 0; col < 4; col++) {
  19. printf(strchr(start, keypad[row][col]) ? "#" : " ");
  20. }
  21. if (!end) break;
  22. *end = ' ';
  23. start = end + 1;
  24. printf(" ");
  25. }
  26. printf("\n");
  27. }
  28. return 0;
  29. }
  30.  
Success #stdin #stdout 0s 2168KB
stdin
Standard input is empty
stdout
       #     #  
# #   # #   # # 
 #     #    ### 
# #   #     # #