cin >> voteNum; gets(votePerson); cin执行完后 gets不会执行。 解决方法: cin >> voteNum; gets(votePerson); gets(votePerson); 可以输入。