fork download
  1. #include<stdio.h>
  2. int conversion(int txt);
  3.  
  4. int main ()
  5. {
  6. int ch1;
  7.  
  8. printf("대소문자 변환기:");
  9. ch1=getchar();
  10. putchar(conversion(ch1));
  11. }
  12. int conversion(int txt)
  13. {
  14. int num1 = 97-65;
  15.  
  16. if (txt>='A' && txt<='Z')
  17. return txt + num1;
  18. else if (txt>='a' && txt<='z')
  19. return txt - num1;
  20. else
  21. return -1;
  22. }
  23.  
Success #stdin #stdout 0s 2172KB
stdin
a
stdout
대소문자 변환기:A