![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++
CaoPengCheng&
我是一只小菜鸟,咿呀咿呀哟
展开
-
C++_构造函数
C++_构造函数#include<iostream>using namespace std;/** * @author CaoPengCheng * @date 2021-10-09 */class Date{public: Date(int,int,int); Date(int,int); Date(int); Date(); void disPlay();private: int month; int day; int year;};Date::Da原创 2021-10-09 14:54:53 · 95 阅读 · 0 评论 -
C++_用类的方法编程程序完成求3个长方体的体积。
C++_用类的方法编程程序完成求3个长方体的体积。#include<iostream>using namespace std;/** * 用类的方法编程程序完成求3个长方体的体积。数据成员包括长(length)、宽(width)、高(length)。 * @author CaoPengCheng * @date 2021-10-09 */class Box{private: int length; int width; int high;public: void s原创 2021-10-09 14:36:24 · 690 阅读 · 0 评论 -
C++_用类实现对5个学生的姓名,学号,性别的输入与输出。
C++_用类实现对5个学生的姓名,学号,性别的输入与输出。#include<iostream>using namespace std;/** * 用类实现对5个学生的姓名,学号,性别的输入与输出。要求类外定义成员函数 * @author CaoPengCheng * @date 2021-10-07 */class Student{private: char name[40]; long number; char sex[4];public: void setDat原创 2021-10-09 14:15:03 · 3539 阅读 · 0 评论 -
C++_对n个数据进行从小到大的排序
C++_对n个数据进行从小到大的排序#include<iostream>using namespace std;/** * 对n个数据进行从小到大的排序 * @project C++_Demo * @author CaoPengCheng * @date 2021-09-09 * @version 1.0.0 */class Number{private: int n; int a[100];public: Number(){ } Number(int N){原创 2021-09-09 14:03:54 · 3572 阅读 · 2 评论 -
C++_类
C++_类#include<iostream>#include<algorithm>using namespace std;/** * @project C++_Demo * @author CaoPengCheng * @date 2021-09-07 * @version 1.0.0 */class Student{private: int num; float score;public: void setData(){ cout<<原创 2021-09-09 11:41:45 · 65 阅读 · 0 评论 -
C++_输入3个数分别按由大到小的顺序输出,数据可以是整型、单精度型、双精度型,要求使用变量的引用 和函数模板
C++_输入3个数分别按由大到小的顺序输出,数据可以是整型、单精度型、双精度型,要求使用变量的引用 和函数模板#include<iostream>#include<algorithm>using namespace std;/** * 输入3个数分别按由大到小的顺序输出,数据可以是整型、单精度型、双精度型,要求使用变量的引用 和函数模板 * @project C++_Demo * @author CaoPengCheng * @date 2021-09-07 * @原创 2021-09-09 11:20:55 · 2756 阅读 · 0 评论 -
C++_输入2个整数,并由大到小的顺序输出
C++_输入2个整数,并由大到小的顺序输出#include<iostream>using namespace std;/** * 输入2个整数,并由大到小的顺序输出 * @project C++_Demo * @author CaoPengCheng * @date 2021-09-07 * @version 1.0.0 */int main(){ int a,b; cout<<"input 2 number:"; cin>>a>>b原创 2021-09-07 14:57:45 · 5647 阅读 · 0 评论 -
C++_求2个或3个正整数中的最大数,用带有默认参数的函数实现
C++_求2个或3个正整数中的最大数,用带有默认参数的函数实现#include<iostream>using namespace std;/** * 求2个或3个正整数中的最大数,用带有默认参数的函数实现 * @project C++_Demo * @author CaoPengCheng * @date 2021-09-07 * @version 1.0.0 */int main(){ int max(int a,int b,int c=0); int a,b,c;原创 2021-09-07 14:41:53 · 6678 阅读 · 0 评论 -
C++_输入一个字符串,并逆序输出
C++_输入一个字符串,并逆序输出#include<iostream>#include<string>using namespace std;/** * 输入一个字符串,并逆序输出 * @project C++_Demo * @author CaoPengCheng * @date 2021-09-07 * @version 1.0.0 */int main(){ char a[100]; cout<<"input String:"; cin&原创 2021-09-07 14:26:57 · 9412 阅读 · 3 评论 -
第一个C++程序
第一个C++程序#include <iostream>using namespace std;int main(){ cout<<"This is C++ Program!\n"; cout<<"世界和平!\n"; return 0;}原创 2021-09-01 23:33:59 · 86 阅读 · 0 评论