题目:设有3个候选人,最终只能有1人当选。今有10个人参加投票,从键盘先后输入这10个人所投的候选人的名字,要求最后输出这3个候选人的得票结果。
#include <iostream>
#include<cstring>
using namespace std;
struct Person//声明结构体类型Person
{
char name[20];
int count
题目:设有3个候选人,最终只能有1人当选。今有10个人参加投票,从键盘先后输入这10个人所投的候选人的名字,要求最后输出这3个候选人的得票结果。
#include <iostream>
#include<cstring>
using namespace std;
struct Person//声明结构体类型Person
{
char name[20];
int count