In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)05/31 Report--
In this article, the editor introduces "c language structure body array example analysis" in detail, the content is detailed, the steps are clear, and the details are handled properly. I hope this article "c language structure body array example analysis" can help you solve your doubts. Let's follow the editor's ideas to learn new knowledge.
An example of structure array program
Ex.: election voting procedure. There are three candidates to participate in the election, the number of voters is n, each person can only cast one vote, enter the number n and the candidate name of each candidate from the keyboard, count and output the number of votes of each candidate.
# include
# include
Struct candicate / / defines the structure type of the candidate
{
Char name [20]; / / name
Int count; / / number of votes obtained
}
Int main ()
{
Struct candicate cand [] = {"zhang", 0, "li", 0, "wang", 0}
Int n,i,j
Char name [20]
Printf ("Please enter the number of voters:")
Scanf ("d", & n)
Printf ("enter candidate names for all [% d] voters:\ n", n)
For (iTunes 1)
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.