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

DiyVM(50元起)老牌商家,香港沙田CN2直连vps/不限流量/五折终身优惠

diyvm怎么样?diyvm是一家国内成立时间比较久的主机商家了,大约在6年前站长曾经用过他家的美国机房的套餐,非常稳定,适合做站,目前商家正在针对香港沙田机房的VPS进行促销,给的是五折优惠,续费同价,香港沙田机房走的是CN2直连的线路,到大陆地区的速度非常好,DiyVM商家采用小带宽不限流量的形式,带宽2Mbps起步,做站完全够用,有需要的朋友可以入手。diyvm优惠码:五折优惠码:OFF50...

无忧云( 9.9元/首月),河南洛阳BGP 2核 2G,大连BGP线路 20G高防 ,

无忧云怎么样?无忧云服务器好不好?无忧云值不值得购买?无忧云,无忧云是一家成立于2017年的老牌商家旗下的服务器销售品牌,现由深圳市云上无忧网络科技有限公司运营,是正规持证IDC/ISP/IRCS商家,自营有国内雅安高防、洛阳BGP企业线路、香港CN2线路、国外服务器产品等,非常适合需要稳定的线路的用户,如游戏、企业建站业务需求和各种负载较高的项目,同时还有自营的高性能、高配置的BGP线路高防物理...

虎跃云-物理机16H/32G/50M山东枣庄高防BGP服务器低至550元每月!

虎跃科技怎么样?虎跃科技(虎跃云)是一家成立于2017年的国内专业服务商,专业主营云服务器和独立服务器(物理机)高防机房有着高端华为T级清洗能力,目前产品地区有:山东,江苏,浙江等多地区云服务器和独立服务器,今天虎跃云给大家带来了优惠活动,为了更好的促销,枣庄高防BGP服务器最高配置16核32G仅需550元/月,有需要的小伙伴可以来看看哦!产品可以支持24H无条件退款(活动产品退款请以活动规则为准...

容器类为你推荐
isbackgroundbokeh是什么意思mergefield邮件合并日期,想让电子表格中的日期格式与WORD中的日期格式一致shoujiao求【叫兽】的简介sms是什么短信确认码是什么gas是什么意思gc是什么意思啊?cursorlocationsession("rs").cursorlocation=3是什么意思?flash序列号急求flash序列号particular教程如何用AE做出花瓣从身体变出来的特效backupexec如何在Backup Exec 2012中添加要备份的Windows服务器acceptchangesaltium designer 6.0如何给元件重新编号
看国外视频直播vps 独享100m a2hosting ion 香港机房 警告本网站 165邮箱 帽子云 softbank邮箱 老左来了 hinet idc是什么 卡巴斯基破解版 drupal安装 yundun 上海电信测速网站 阿里云免费邮箱 美国代理服务器 侦探online 在线tracert 更多