第15周阅读程序(6)
来源:互联网 发布:小学语文网络课程 编辑:程序博客网 时间:2024/05/30 23:36
/**Copyright (c) 2016,烟台大学计算机学院*All rights reserved.*文件名称 :*作 者 : 刘云*完成日期 : 2016年6月7号*版 本 号 : v6.0**问题描述 : 阅读程序*输入描述 :无*程序输出 :*/#include<string>#include<iostream>#include<map>using namespace std;class CStudent{public: int nStudentID; int nAge;public: CStudent(){ } CStudent(int nSID,int nA) { nStudentID=nSID; nAge=nA; } //复制构造函数 CStudent(const CStudent& ob) { nStudentID=ob.nStudentID; nAge=ob.nAge; }};int main(){ map<string,CStudent>mapStudent; mapStudent["zhangsan"]=CStudent(100012,22); mapStudent["Lisi"]=CStudent(100085,21); mapStudent["Wangwu"]=CStudent(100093,23); cout<<"The Student number for Lisi is "<<(mapStudent["Lisi"].nStudentID)<<endl; return 0;}
运行结果:
0 0
- 第15周-阅读程序(6)
- 第15周阅读程序(6)
- 第15周阅读程序(6)
- 第15周阅读程序(6)
- 第15周阅读程序(6)
- 第15周程序阅读6
- 第15周-阅读程序(1)
- 第15周-阅读程序(2)
- 第15周-阅读程序(3)
- 第15周-阅读程序(4)
- 第15周-阅读程序(5)
- 第15周阅读程序(1)
- 第15周阅读程序(2)
- 第15周阅读程序(3)
- 第15周阅读程序(4)
- 第15周阅读程序(5)
- 第15周阅读程序(1)
- 第15周阅读程序(2)
- Spring JDBC 的使用
- 视频框架 Vitamio 使用教程+部分心得 (二)第一个视频demo
- 初识html(2)
- microstation level2 1002 hatch with cell
- 用Mockplus教你使用属性面板的设置交互状态
- 第15周阅读程序(6)
- Android 基于Message的进程间通信 Messenger完全解析
- 八数码问题 bfs
- OKHttp详解
- 分数类中的运算符重载(3)(4)
- TopCoder SRM 637 Div2 C
- android下拉刷新和listview冲突 - listview不能下拉到头部
- 在Java中如何遍历Map对象
- Vitamio的使用