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

标准互联(450元)襄阳电信100G防御服务器 10M独立带宽

目前在标准互联这边有两台香港云服务器产品,这不看到有通知到期提醒才关注到。平时我还是很少去登录这个服务商的,这个服务商最近一年的促销信息比较少,这个和他们的运营策略有关系。已经从开始的倾向低价和个人用户云服务器市场,开始转型到中高端个人和企业用户的独立服务器。在这篇文章中,有看到标准互联有推出襄阳电信高防服务器100GB防御。有三款促销方案我们有需要可以看看。我们看看几款方案配置。型号内存硬盘IP...

无视CC攻击CDN ,DDOS打不死高防CDN,免备案CDN,月付58元起

快快CDN主营业务为海外服务器无须备案,高防CDN,防劫持CDN,香港服务器,美国服务器,加速CDN,是一家综合性的主机服务商。美国高防服务器,1800DDOS防御,单机1800G DDOS防御,大陆直链 cn2线路,线路友好。快快CDN全球安全防护平台是一款集 DDOS 清洗、CC 指纹识别、WAF 防护为一体的外加全球加速的超强安全加速网络,为您的各类型业务保驾护航加速前进!价格都非常给力,需...

Megalayer(48元)新增 美国CN2优化线路特价服务器和VPS方案

Megalayer 商家算是新晋的服务商,商家才开始的时候主要是以香港、美国独立服务器。后来有新增菲律宾机房,包括有VPS云服务器、独立服务器、站群服务器等产品。线路上有CN2优化带宽、全向带宽和国际带宽,这里有看到商家的特价方案有增加至9个,之前是四个的。在这篇文章中,我来整理看看。第一、香港服务器系列这里香港服务器会根据带宽的不同区别。我这里将香港机房的都整理到一个系列里。核心内存硬盘IP带宽...

容器类为你推荐
ata考试什么是计算机ATA考试?要详细答案!谢谢帮忙!!prisma安卓版prisma 安卓版本为什么不能使用ico监管新加坡代币ICO备案怎么做代发邮件邮件代发会不会有短信代发那么好的市场效益呢?shoujiao求【叫兽】的简介comexception5种常见的Exception!腾讯合作伙伴大会腾讯的合作伙伴都有动画分镜头脚本动画分镜头台本的作用?ocr软件下载哪个图片转文字软件比较好用?怎么查微信注册时间怎么知道微信上次登录时间
注册cn域名 warez duniu GGC isatap cloudstack rak机房 免费名片模板 web服务器架设软件 个人免费空间 骨干网络 dd444 福建天翼加速 天互数据 泉州移动 免费网页空间 空间登入 丽萨 沈阳主机托管 智能dns解析 更多