Home > Back-end >  Consult algorithm notes on a basic question!
Consult algorithm notes on a basic question!

Time:01-02

Vote the candidates to complete a statistical procedure, assuming that there are three candidates, name is Li respectively, Zhang and Fun, using structure to store each candidate's name and votes, record every vote votes, names, output each candidate the final vote, structure can be defined as the following format:
Struct person {
char name[20];
Int count;
} leader [3]={" Li, "0," Zhang, "0," Fun ", 0};

Of structures in the last line array is why add 0.
Leader [3]={" Li ", "Zhang", "Fun"}; Can't you so where is the wrong


What is the principle of the original problem!

The small white a bosses, please help!

CodePudding user response:

0 is the corresponding structure in the count, it is leader of the array [3] the initialization, the structure of each of the elements are initialized,
  • Related