C언어/C언어 문제
[C언어] 백준 1032번: 명령 프롬프트
renne
2022. 8. 11. 21:35
https://www.acmicpc.net/problem/1032
1032번: 명령 프롬프트
첫째 줄에 파일 이름의 개수 N이 주어진다. 둘째 줄부터 N개의 줄에는 파일 이름이 주어진다. N은 50보다 작거나 같은 자연수이고 파일 이름의 길이는 모두 같고 길이는 최대 50이다. 파일이름은
www.acmicpc.net

#include <stdio.h>
#include <string.h>
int main(){
int n, len;
char str[50][51];
scanf("%d", &n);
for (int i = 0; i < n; i++){
scanf("%s", str[i]);
}
len = strlen(str[0]);
for (int i = 0; i < n; i++){
for (int j = 0; j < len; j++){
if (str[0][j] != str[i][j]){
str[0][j] = '?';
}
}
}
printf("%s", str[0]);
return 0;
}
