04737 C++程序设计份历年真题1答案(2020年12月整理).doc

上传人:摩西的****12 文档编号:153966264 上传时间:2020-12-03 格式:DOC 页数:14 大小:4.49MB
返回 下载 相关 举报
04737 C++程序设计份历年真题1答案(2020年12月整理).doc_第1页
第1页 / 共14页
04737 C++程序设计份历年真题1答案(2020年12月整理).doc_第2页
第2页 / 共14页
04737 C++程序设计份历年真题1答案(2020年12月整理).doc_第3页
第3页 / 共14页
04737 C++程序设计份历年真题1答案(2020年12月整理).doc_第4页
第4页 / 共14页
04737 C++程序设计份历年真题1答案(2020年12月整理).doc_第5页
第5页 / 共14页
点击查看更多>>
资源描述

《04737 C++程序设计份历年真题1答案(2020年12月整理).doc》由会员分享,可在线阅读,更多相关《04737 C++程序设计份历年真题1答案(2020年12月整理).doc(14页珍藏版)》请在金锄头文库上搜索。

1、switch语句,找到第一个满足的case之后,如果没有break,会继续执行后面的case语句. double operator()(double x,double y) const;#include #include using namespace std;class Birthdaypublic:Birthday(int y,int m,int d);Show();private:int year;int month;int day;Birthday:Birthday(int y,int m,int d)year = y;month = m;day = d;Birthday:Show()

2、coutyear-month-dayendl;class Personpublic:Person(string n,string s,int y,int m,int d);Person( );Show();private:string name;string sex;Birthday* birthday;Person:Person(string n,string s,int y,int m,int d)name = n;sex = s;birthday = new Birthday(y,m,d);Person:Person( )if ( birthday != NULL )delete birthday;birthday = NULL;Person:Show()cout姓名:nameendl;cout性别:sexendl;coutShow( );void main( )Person* p = new Person(张三,女,2000,10,13);p-Show();delete p;14C+程序设计 试卷第 页 共 14 页

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 办公文档 > 其它办公文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号