Assignment 6
Scripting Problem (5 points)
The goal of this problem is to find the current user’s group with the largest number of members with the exclusion of the group users. That is, considering the groups that the current user belongs to (with the exclusion of the group users), which one is composed of the largest number of members? (Don’t worry about ties)
Start by looking at the file /etc/group, which contains the members belonging to each group in the following format: groupname:x:groupid:comma_separated_list_of_members
For example, the entry corresponding to group OMIS107_ADMIN is as follows:
OMIS107_ADMIN:x:1003:msamorani,samo,labinstructorYour output should be formatted as follows:
The current user's most numerous group is xxxx, which has yyyy members
Note: no need to explicitly exclude the group users, because that group is not present in /etc/group.
Examples:
Output if fakestudent executes your code:

Output if samo executes your code:

公众号:AI悦创【二维码】

AI悦创·编程一对一
AI悦创·推出辅导班啦,包括「Python 语言辅导班、C++ 辅导班、java 辅导班、算法/数据结构辅导班、少儿编程、pygame 游戏开发、Web、Linux」,全部都是一对一教学:一对一辅导 + 一对一答疑 + 布置作业 + 项目实践等。当然,还有线下线上摄影课程、Photoshop、Premiere 一对一教学、QQ、微信在线,随时响应!微信:Jiabcdefh
C++ 信息奥赛题解,长期更新!长期招收一对一中小学信息奥赛集训,莆田、厦门地区有机会线下上门,其他地区线上。微信:Jiabcdefh
方法一:QQ
方法二:微信:Jiabcdefh

更新日志
1c35a-于aed17-于10425-于3f503-于72074-于068d1-于4e656-于01745-于27023-于a1f1e-于cbb3a-于610fe-于f08aa-于76989-于86c50-于027da-于