文件名称:PA1-2(1)
介绍说明--下载内容来自于网络,使用问题请自行百度
描述
公司有n个员工,编号1 ~ n。员工数量众多,需要你为他们编写一个管理系统。
员工上班时都要登录管理系统登记一个code,离开要从管理系统上注销,员工也可以随时更新自己的code。到了下班时间,所有员工都会自动注销。公司管理人员随时都可能想要知道有多少员工上班,以及任一员工登记的code。
输入
第一行两个整数n、m。接下来m行,每行都是以下内容之一:
I a c //Log In:员工a登录,code为c。若a已登录,则将code更新为c
O a //Log Out:编号为a的员工注销。若a未登录,则注销无效
C //Close:到下班时间,所有员工注销
N //Number:询问有多少员工正在上班
Q a //Query:询问员工a的code(若未登录或已注销,视为-1)
输出
一个整数,是所有询问(N、Q)的答案之和(int表示,自动溢出,不用管溢出部分)-N Descr iption The company has employees, numbered 1 ~ n. The large number of employees, you need to prepare a management system for them. Employees must log in to register a code management system, the cancellation of leave management system, employees can update their own code at work. The working hours, all employees will be automatically canceled. Company management at any time may want to know how many employees work, as well as any employee registration code. The first line of input two integers n, m. Next m lines, one per line are the following: I a c // Log In: employee a login, code to c. If you have a login code will be updated c O a // Log Out: Number of employees as a cancellation. If a logged in, then log out invalid C // Close: working hours to all employees cancellation N // Number: asked how many employees are at work Q a // Query: ask a staff of code (if not log on or log off, regarded as-1) outputs an integer, is all inquiries (N, Q) and the answer (int said automatic
公司有n个员工,编号1 ~ n。员工数量众多,需要你为他们编写一个管理系统。
员工上班时都要登录管理系统登记一个code,离开要从管理系统上注销,员工也可以随时更新自己的code。到了下班时间,所有员工都会自动注销。公司管理人员随时都可能想要知道有多少员工上班,以及任一员工登记的code。
输入
第一行两个整数n、m。接下来m行,每行都是以下内容之一:
I a c //Log In:员工a登录,code为c。若a已登录,则将code更新为c
O a //Log Out:编号为a的员工注销。若a未登录,则注销无效
C //Close:到下班时间,所有员工注销
N //Number:询问有多少员工正在上班
Q a //Query:询问员工a的code(若未登录或已注销,视为-1)
输出
一个整数,是所有询问(N、Q)的答案之和(int表示,自动溢出,不用管溢出部分)-N Descr iption The company has employees, numbered 1 ~ n. The large number of employees, you need to prepare a management system for them. Employees must log in to register a code management system, the cancellation of leave management system, employees can update their own code at work. The working hours, all employees will be automatically canceled. Company management at any time may want to know how many employees work, as well as any employee registration code. The first line of input two integers n, m. Next m lines, one per line are the following: I a c // Log In: employee a login, code to c. If you have a login code will be updated c O a // Log Out: Number of employees as a cancellation. If a logged in, then log out invalid C // Close: working hours to all employees cancellation N // Number: asked how many employees are at work Q a // Query: ask a staff of code (if not log on or log off, regarded as-1) outputs an integer, is all inquiries (N, Q) and the answer (int said automatic
(系统自动生成,下载前可以参看下载内容)
下载文件列表
PA1-2(1).cpp
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.