#include <stdio.h>
int subst(char *str, char c1, char c2){
while(*str){
if(*str == c1){
*str = c2;
}
str++;
}
return *str;
}
main(){
char str[100];
char s1[10], s2[10];
printf("文字を入力してください:");
scanf("%s", str);
printf("変換する文字を入力してください:");
scanf("%s", s1);
printf("何に変換しますか:");
scanf("%s", s2);
printf("変換後の文字列は%sです。\n", subst(str, s1[0], s2[0]));
return 0;
}