fork download
  1. #include <stdio.h>
  2. #include <ctype.h>
  3. #include <string.h>
  4.  
  5. int main(void)
  6. {
  7. char str[1024];
  8.  
  9. while (fgets(str, sizeof(str), stdin) != 0)
  10. {
  11. int size = strlen(str);
  12. for (int i = 0; i < size; i++)
  13. {
  14. if (toupper((unsigned char)str[i]) == 'Z')
  15. {
  16. str[i] = 'A';
  17. }
  18. else if (isalpha((unsigned char)str[i]))
  19. {
  20. str[i] -= 1;
  21. }
  22. printf("%c", str[i]);
  23. }
  24. }
  25.  
  26. return 0;
  27. }
Success #stdin #stdout 0s 2172KB
stdin
BZ
stdout
AA