fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int i, count = 0;
  5. char s[100];
  6.  
  7.  
  8. printf("文字列を入力してください:");
  9. scanf("%s", s);
  10.  
  11. printf("修正前: %s\n", s);
  12.  
  13. for (i = 0; s[i] != '\0'; i++) {
  14. if (s[i] == '1') {
  15. s[i] = 'I';
  16. count++;
  17. }
  18. }
  19.  
  20. printf("修正後: %s\n", s);
  21.  
  22. return 0;
  23. }
  24.  
Success #stdin #stdout 0.01s 5288KB
stdin
1NFORMAT1ON
stdout
文字列を入力してください:修正前: 1NFORMAT1ON
修正後: INFORMATION