다음 코드에서 scanf의 문제를 제외한 문제점을 파악하고 해결책을 제시하여라.
힌트: 컴파일은 문제가 없고 실행도 되지만 사용자 입력에 따라서 문제가 생길 수 있다.
채점: 문제점 5점, 해결책 5점
제출방식: 홈페이지 참조
#include <stdio.h> #include <stdlib.h> #include <random> int main( void ) { char word_list[10][20]; int word_cnt; printf("How many words do you want?:"); scanf("%d", &word_cnt); printf("Please enter %d words\n", word_cnt); for( int i=0; i<word_cnt; i++) { printf("Enter %d th word:", i+1); scanf("%s", word_list[i]); } printf("## Word List ##\n"); for( int i=0; i<10; i++) { printf("The %d th word is %s\n", i+1, word_list[i]); } system("pause"); return 0; }