C++ 实验七

摘要: #include <iostream> #include <fstream> using namespace std; int main(){ ofstream file; file.open("E:\\text.txt"); file << "已成功写入文件!" << endl; file.clo 阅读全文
posted @ 2018-06-20 15:32 nuo267 阅读(93) 评论(0) 推荐(0) 编辑

C++ 实验六

摘要: #include<iostream> using namespace std; class ABC { public: void abc(int x, int y){ m = x; n = y; } void add() { cout << m + n << endl; } private: int 阅读全文
posted @ 2018-06-07 23:39 nuo267 阅读(105) 评论(0) 推荐(0) 编辑

C++ 实验五

摘要: 6-17 指针是指向一个地址的,其本身没有意义,直接赋值并没有分配内存空间给它,所以用new申请内存空间来存放这个值//应该是这样吧-- 6-18 内存泄漏,用delete释放 ran是伪随机,所以用了<time.h>当前时间作为种子,算是比较像真随机吧。 阅读全文
posted @ 2018-05-23 22:29 nuo267 阅读(120) 评论(0) 推荐(0) 编辑

C++ 实验四

摘要: project1.h project1.cpp main.cpp 总结 这次实验第一题还行,就是金字塔显示我想了一会,如何循环我注释出来了 第二题和上次实验有题有点类似,我参考了一下上次实验的题写的代码--,运行是没错,要是前面有错可以点一下,我觉得我是看不出来了 阅读全文
posted @ 2018-04-23 22:36 nuo267 阅读(137) 评论(0) 推荐(0) 编辑

c++ 实验三

摘要: #include using namespace std; class rectangle { public: rectangle(float l, float w); float area(); private: float length, width; }; rectangle::rectangle(float l, float w) { length = l... 阅读全文
posted @ 2018-04-08 23:26 nuo267 阅读(102) 评论(1) 推荐(0) 编辑

c++ 实验二

摘要: #include using namespace std; int main() { char n; cout>n; if(n=='A'){ cout using namespace std; int main() { char n; cout > n; switch(n){ case'A': ... 阅读全文
posted @ 2018-03-24 23:19 nuo267 阅读(147) 评论(0) 推荐(0) 编辑

c++ 实验一

摘要: 代码写完后再看就觉得简单多了,但是实际刚才做的时候遇到了许多困难,然后一一解决才最终完成 应该是我还不太熟练吧,接下来需要多加练习 第二题复位这一步开始没写,导致结果是0,这需要注意 计算正确数字时位数是乘10的(n-1)次,也需要注意 阅读全文
posted @ 2018-03-16 22:52 nuo267 阅读(96) 评论(1) 推荐(0) 编辑