【C】#牛牛的替换#
牛牛的替换
https://www.nowcoder.com/practice/f2a107dbb99243798d3048a672e8f747
#include <stdio.h> int main() { int n; char a1, a2, a3, a4; scanf("%d %c %c %c %c", &n, &a1, &a2, &a3, &a4); char arr[n + 1]; scanf("%s", arr); for (int i = 0; i < n; i++) { if (arr[i] == a1) arr[i] = a2; if (arr[i] == a3) arr[i] = a4; } printf("%s", arr); return 0; }