fork download
  1. // Question:08 Broken keyboard
  2.  
  3. #include <stdio.h>
  4.  
  5. void keybord(char a[]);
  6.  
  7. int main()
  8. {
  9. char a[500];
  10. scanf("%s", &a);
  11.  
  12. keybord(a);
  13. return 0;
  14. }
  15.  
  16. void keybord(char a[])
  17. {
  18. int i = 0;
  19. while (a[i] != '\0')
  20. {
  21. int broken = i + 1;
  22.  
  23. if (broken % 2 == 0)
  24. printf("%c%c", a[i], a[i]);
  25.  
  26. else
  27. printf("%c", a[i]);
  28.  
  29. i++;
  30. }
  31. }
Success #stdin #stdout 0.01s 5360KB
stdin
abcd
stdout
abbcdd