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

ZJI(月付450元),香港华为云线路服务器、E3服务器起

ZJI发布了9月份促销信息,针对香港华为云线路物理服务器华为一型提供立减300元优惠码,优惠后香港华为一型月付仅450元起。ZJI是原来Wordpress圈知名主机商家:维翔主机,成立于2011年,2018年9月更名为ZJI,提供中国香港、台湾、日本、美国独立服务器(自营/数据中心直营)租用及VDS、虚拟主机空间、域名注册等业务,商家所选数据中心均为国内访问质量高的机房和线路,比如香港阿里云、华为...

半月湾($59.99/年),升级带宽至200M起步 三网CN2 GIA线路

在前面的文章中就有介绍到半月湾Half Moon Bay Cloud服务商有提供洛杉矶DC5数据中心云服务器,这个堪比我们可能熟悉的某服务商,如果我们有用过的话会发现这个服务商的价格比较贵,而且一直缺货。这里,于是半月湾服务商看到机会来了,于是有新增同机房的CN2 GIA优化线路。在之前的文章中介绍到Half Moon Bay Cloud DC5机房且进行过测评。这次的变化是从原来基础的年付49....

腾讯云轻量应用服务器关于多个实例套餐带宽

腾讯云轻量应用服务器又要免费升级配置了,之前已经免费升级过一次了(腾讯云轻量应用服务器套餐配置升级 轻量老用户专享免费升配!),这次在上次的基础上再次升级。也许这就是良心云吧,名不虚传。腾讯云怎么样?腾讯云好不好。腾讯云轻量应用服务器 Lighthouse 是一种易于使用和管理、适合承载轻量级业务负载的云服务器,能帮助个人和企业在云端快速构建网站、博客、电商、论坛等各类应用以及开发测试环境,并提供...

容器类为你推荐
ipv6电视什么是ipv6网络电视 有什么好处无处不在的意思心无所住是什么意思云输入法QQ云输入法怎样进行中英文切换?java程序员招聘Java程序员,一般招聘都要求些啥网络安全密钥网络安全密钥和wifi密码有什么区别cursorlocation如何用ENVI把不同图像中的相同地点的某个像素点的值读出来。按时间把这个点的值连起来,。谢谢好人。za是哪个国家的IE是哪个国家的缩写gbk内码怎么查GBK内码?怎么查微信注册时间怎么查对方的微信号什么时候注册的泛微协同办公系统泛微oa怎么样?我想了解一下,有用过的同仁帮忙!发表下自己的观点(天津)
香港vps主机 阿里云邮箱登陆首页 唯品秀 主机 台湾谷歌地址 193邮箱 空间合租 天翼云盘 卡巴斯基是免费的吗 怎么建立邮箱 web服务器搭建 1元域名 cxz 工信部icp备案查询 域名转入 中国联通宽带测试 广州主机托管 hdroad zcloud windowsserver2008r2 更多