fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. static const char dtmf_positions[] = "123A-------"
  5. "456B-------"
  6. "789C-------"
  7. "*0#D-------"
  8. "----E------"
  9. "-----F-----"
  10. "------G----"
  11. "-------H---"
  12. "--------J--"
  13. "---------K-"
  14. "----------L";
  15. #define NCOLS (sizeof("123A-------") - 1)
  16. #define FETCH_CHAR(ROW,COL) dtmf_positions[ROW * NCOLS + COL]
  17.  
  18. printf("%c%c%c%c\n", FETCH_CHAR(2, 3), FETCH_CHAR(7, 7), FETCH_CHAR(4, 4), FETCH_CHAR(5, 5));
  19. return 0;
  20. }
  21.  
Success #stdin #stdout 0s 2008KB
stdin
Standard input is empty
stdout
CHEF