fork download
  1. #include<stdio.h>
  2. #include<ctype.h>
  3. int main()
  4. {
  5. char d[256], *p;
  6. printf("文字列を入力してください > ");
  7. fgets(d, sizeof(d), stdin);
  8. p = d;
  9. do {
  10. if (isupper(*p))
  11. *p = tolower(*p);
  12. else if (islower(*p))
  13. *p = toupper(*p);
  14. } while (*p++);
  15. printf("変換文字列 = %s\n", d);
  16. return 0;
  17. }
  18.  
Success #stdin #stdout 0s 2164KB
stdin
The C languege
stdout
文字列を入力してください > 変換文字列 = tHE c LANGUEGE