摘要: #include <iostream> #include <fstream> #include <string> #include <cstdlib> using namespace std; int main() { ofstream fout; fout.open("3.txt",ios_bas 阅读全文
posted @ 2019-06-11 20:29 Yyao丶 阅读(118) 评论(0) 推荐(0) 编辑
摘要: #pragma once #include<string> using namespace std; class MachinePets { public: MachinePets(const string s); ~MachinePets(); const string getNickname() 阅读全文
posted @ 2019-06-03 23:22 Yyao丶 阅读(89) 评论(0) 推荐(0) 编辑
摘要: project1: #ifndef BATTERY_H #define BATTERY_H class Battery { public: Battery(int batterySize0 = 70); Battery(const Battery& b0); int getbattery(); pr 阅读全文
posted @ 2019-05-18 23:24 Yyao丶 阅读(222) 评论(2) 推荐(0) 编辑
摘要: 编程题 1 // 工具包头文件,用于存放函数声明 // 函数声明 bool isLeap(int); // 功能描述: // 判断year是否是闰年, 如果是,返回true; 否则,返回false bool isLeap(int year) { if( (year % 4 == 0 && year 阅读全文
posted @ 2019-04-30 14:57 Yyao丶 阅读(114) 评论(0) 推荐(0) 编辑
摘要: 1.graph类 #ifndef GRAPH_H #define GRAPH_H // 类Graph的声明 class Graph { public: Graph(char ch, int n); // 带有参数的构造函数 void draw(); // 绘制图形 private: char sym 阅读全文
posted @ 2019-04-22 17:40 Yyao丶 阅读(97) 评论(2) 推荐(0) 编辑
摘要: Complex类 阅读全文
posted @ 2019-04-02 19:37 Yyao丶 阅读(107) 评论(0) 推荐(0) 编辑
摘要: 函数重载编程练习 函数模板编程练习 头文件quicksort.h 主函数 类的定义、实现和使用编程练习 实验总结体会:1. 快速排序,上课的时候毫无头绪,课后查阅了一些资料后搞懂了。 2. 快速排序在数据量较多时能有效减少计算机的工作负担。 3. 对于类的定义和使用现在只能刻板的根据书本模仿,还不能 阅读全文
posted @ 2019-03-25 21:25 Yyao丶 阅读(135) 评论(1) 推荐(1) 编辑
摘要: 2-28 2-29 2-32 2-34 无顺序: 有顺序: 第二章知识框架 实践中的问题: 1. 在实验2-28中发现:如果输入两个字母的指令会输出两次,还没有搞清楚原因是什么。觉得应该是依次只能输入一个指令,就相当于输入了两次。 2. 第一次写2-29用stew控制cout输出长度时没有包含<io 阅读全文
posted @ 2019-03-17 19:22 Yyao丶 阅读(207) 评论(6) 推荐(0) 编辑