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