容器类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++著作。

Digital-VM:服务器,$80/月;挪威/丹麦英国/Digital-VM:日本/新加坡/digital-vm:日本VPS仅$2.4/月

digital-vm怎么样?digital-vm在今年1月份就新增了日本、新加坡独立服务器业务,但是不知为何,期间终止了销售日本服务器和新加坡服务器,今天无意中在webhostingtalk论坛看到Digital-VM在发日本和新加坡独立服务器销售信息。服务器硬件是 Supermicro、采用最新一代 Intel CPU、DDR4 RAM 和 Enterprise Samsung SSD内存,默认...

美国200G美国高防服务器16G,800元

美国高防服务器提速啦专业提供美国高防服务器,美国高防服务器租用,美国抗攻击服务器,高防御美国服务器租用等。我们的海外高防服务器带给您坚不可摧的DDoS防护,保障您的业务不受攻击影响。HostEase美国高防服务器位于加州和洛杉矶数据中心,均为国内访问速度最快最稳定的美国抗攻击机房,带给您快速的访问体验。我们的高防服务器配有最高层级的DDoS防护系统,每款抗攻击服务器均拥有免费DDoS防护额度,让您...

A400互联37.8元/季,香港节点cn2,cmi线路云服务器,1核/1G/10M/300G

A400互联怎么样?A400互联是一家成立于2020年的商家,A400互联是云服务器网(yuntue.com)首次发布的云主机商家。本次A400互联给大家带来的是,全新上线的香港节点,cmi+cn2线路,全场香港产品7折优惠,优惠码0711,A400互联,只为给你提供更快,更稳,更实惠的套餐,香港节点上线cn2+cmi线路云服务器,37.8元/季/1H/1G/10M/300G,云上日子,你我共享。...

容器类为你推荐
互联网舆情监控系统互联网舆情监控系统软硬件有哪些?订房系统常用的酒店管理软件有哪些小明发布首页永久网站2015小明发布看看永久域在哪里能找到免费的财务系统软件常用财务软件有哪些?prisma安卓版prisma 安卓版本为什么不能使用素数算法有能写出所有素数的公式吗excel大写金额EXCEL如何显示出汉字大写金额手机软件开发工具怎样开发手机软件java程序员招聘Java程序员,一般招聘都要求些啥全局钩子delphi 键盘全局钩子
虚拟主机排名 域名服务器的作用 腾讯云盘 site5 oneasiahost shopex空间 unsplash 京东云擎 服务器架设 全站静态化 坐公交投2700元 刀片服务器是什么 idc资讯 hkg 免费网页空间 国外的代理服务器 lamp是什么意思 国外免费网盘 石家庄服务器 .htaccess 更多