容器类C++中的容器类是类(class)的一种吗?

容器类  时间:2021-06-29  阅读:()

用容器类做一个简单的 学生 管理程序java

package my.test; import java.util.HashMap; import java.util.Map; import java.util.Scanner; /** * @author houseandmouse0 创建日期:2012-11-20 */ public class Student { private int stucode; private String name; private int age; public Student() { } public Student(int stucode, String name, int age) { this.stucode = stucode; this.name = name; this.age = age; } public int getStucode() { return stucode; } public void setStucode(int stucode) { this.stucode = stucode; } public String getName() { return name; } public void setName(String name) { this.name = name; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } @Override public String toString() { return "学生信息[学号=" + stucode + ", 姓名=" + name + ", 年龄=" + age + "]"; } public static void main(String[] args) { Scanner scanner = new Scanner(System.in); Map<Integer,Student> students = new HashMap<Integer, Student>(); while(true){ System.out.println("输入操作类型:"); String op = scanner.nextLine(); if(op==null||op.trim()=="" || op.trim()==" "){ System.out.println("输入不能为空!"); continue; } if(op.trim().equalsIgnoreCase("insert")){ System.out.println("输入学号:"); int stucode = scanner.nextInt(); scanner.nextLine(); System.out.println("输入姓名:"); String name = scanner.nextLine(); System.out.println("输入年龄:"); int age = scanner.nextInt(); scanner.nextLine(); Student student = new Student(stucode, name, age); students.put(stucode, student); continue; } if(op.trim().equalsIgnoreCase("delete")){ System.out.println("输入要删除的学生的学号:"); int stucode = scanner.nextInt(); scanner.nextLine(); Student student = students.get(stucode); if(student==null){ System.out.println("删除失败!原因:学号为 "+stucode+" 的学生不存在!"); }else{ students.remove(stucode); System.out.println("删除成功!"); } continue; } if(op.trim().equalsIgnoreCase("select")){ System.out.println("输入要查询的学生的学号:"); int stucode = scanner.nextInt(); scanner.nextLine(); Student student = students.get(stucode); if(student==null){ System.out.println("查询失败!原因:学号为 "+stucode+" 的学生不存在!"); }else{ System.out.println("查询成功!学号为 "+stucode+" 的学生信息如下:"); System.out.println(student); } continue; } System.out.println("输入有误!"); } } }

化工设备一类二类三类怎么分的,有什么标准

化工设备种类繁多,分类方法具有多种方式方法,例如按结构材质分,可分为碳钢设备、不锈钢设备、非金属设备---。

按承受压力可分为高压设备、中压设备和真空设备、常压设备等。

现按使用功能粗分如下:   (1)化工容器类:有槽、罐、釜等;   (2)分离塔器类:有填料塔、浮阀塔、泡罩塔、转盘塔等   (3)反应器:有管式反应器、流态化反应器、搅拌釜反应器等   (4)换热器:有列管式、板式换热器、蛇管换热器等   (5)加热炉:有电加热炉、管式裂解炉、废热锅炉等;   (6)结晶设备:溶液结晶器、熔融结晶器等   (7)其他各种专用化工设备等。

C++中的容器类是类(class)的一种吗?

自然也是,只不过它可以把其它的类作为其元素来进行一些很方便的操作,像vector, list,queue等等有很多,都在C++的标准模板库(STL)中,这在《C++程序设计语言(特别版)》(机械工业出版社,Bjarne Stroustrup著,裘宗燕译)里面有非常详细并深入的介绍。

那是一本非常经典的C++著作。

易探云服务器怎么过户/转让?云服务器PUSH实操步骤

易探云服务器怎么过户/转让?易探云支持云服务器PUSH功能,该功能可将云服务器过户给指定用户。可带价PUSH,收到PUSH请求的用户在接收云服务器的同时,系统会扣除接收方的款项,同时扣除相关手续费,然后将款项打到发送方的账户下。易探云“PUSH服务器”的这一功能,可以让用户将闲置云服务器转让给更多需要购买的用户!易探云服务器怎么过户/PUSH?1.PUSH双方必须为认证用户:2.买家未接收前,卖家...

云步云72.5元/月起云服务器,香港安畅/葵湾/将军澳/沙田/大浦CN2机房,2核2G5M

云步云怎么样?云步云是创建于2021年的品牌,主要从事出售香港vps、美国VPS、日本VPS、香港独立服务器、香港站群服务器等,机房有香港、美国、日本东京等机房,目前在售VPS线路有CN2+BGP、CN2 GIA,香港的线路也是CN2直连大陆,该公司旗下产品均采用KVM虚拟化架构。目前,云步云提供香港安畅、沙田、大浦、葵湾、将军澳、新世界等CN2机房云服务器,2核2G5M仅72.5元/月起。点击进...

蓝速数据(58/年)秒杀服务器独立1核2G 1M

蓝速数据金秋上云季2G58/年怎么样?蓝速数据物理机拼团0元购劲爆?蓝速数据服务器秒杀爆产品好不好?蓝速数据是广州五联科技信息有限公司旗下品牌云计算平台、采用国内首选Zkeys公有云建设多种开通方式、具有IDC、ISP从业资格证IDC运营商新老用户值得信赖的商家。我司主要从事内地的枣庄、宿迁、深圳、绍兴、成都(市、县)。待开放地区:北京、广州、十堰、西安、镇江(市、县)。等地区数据中心业务,均KV...

容器类为你推荐
instagram电脑版iOS 有哪些优秀的照片处理软件excel大写金额怎么用Excel将小写金额转换成人民币的大写金额刷ip流量请问刷流量刷IP有什么用的!webservice框架用JAVA作APP后端,一般用什么web service?用什么restful框架上行宽带上行宽带是什么?shoujiao求【叫兽】的简介cursorlocation在ENVI中双击遥感图像出来个CURSOR LOCATION/value对话框。下面有个LL : 31?6'21.84"N, 117?9'11.78"E方正证券官方网方正证券完美版下载爱码验证码平台接码验证码接收平台如何使用?在线操作系统常见的电脑操作系统有哪些?各有什么优缺点
cc域名 中国十大域名注册商 gateone 主机合租 qq数据库下载 中国电信测速112 北京双线机房 河南m值兑换 699美元 hinet 免费吧 中国电信宽带测速网 hkt 申请网站 万网主机管理 我的世界服务器ip 东莞服务器托管 浙江服务器 大化网 石家庄服务器 更多