fork download
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. char x, y;
  6. printf("a,b");
  7. scanf(" %c %c", &x, &y);
  8.  
  9. if (x >= 'a' && x <= 'z')
  10. x = x - 32; // 小写转大写
  11. else
  12. x = x + 32; // 大写转小写
  13.  
  14. if (y >= 'a' && y <= 'z')
  15. y = y - 32;
  16. else
  17. y = y + 32;
  18.  
  19. printf("%c %c\n", x, y);
  20. return 0;
  21. }
Success #stdin #stdout 0s 5276KB
stdin
Standard input is empty
stdout
a,b