fork download
  1. #include <stdio.h>
  2. #include <ctype.h>
  3.  
  4. int main() {
  5. char s[10] = {'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x'};
  6. char c;
  7. for (int i = 0; i < 5; i++) {
  8. scanf("%c", &s[i]);
  9. }
  10. for (int i = 0; i < 10; i++) {
  11. printf("%d: %c(%d) ", i, (isprint(c = s[i])) ? c : '*', s[i]);
  12. }
  13. return 0;
  14. }
  15. /* end */
  16.  
Success #stdin #stdout 0s 9424KB
stdin
abcd
stdout
0: a(97) 1: b(98) 2: c(99) 3: d(100) 4: x(120) 5: x(120) 6: x(120) 7: x(120) 8: x(120) 9: x(120)