
程序设计与算法(三)
文章平均质量分 74
7900X
用力奔跑才能尽情呼吸
展开
-
第二周测验 002:奇怪的类复制
总时间限制: 1000ms内存限制: 65536kB描述程序填空,使其输出9 22 5#include <iostream>using namespace std;class Sample {public: int v;// 在此处补充你的代码};void PrintAndDouble(Sample o){ cout << o.v; cout <<...转载 2018-04-15 10:35:32 · 2164 阅读 · 1 评论 -
第二周测验 001:编程填空:学生信息处理程序
总时间限制: 1000ms内存限制: 1024kB描述实现一个学生信息处理程序,计算一个学生的四年平均成绩。要求实现一个代表学生的类,并且类中所有成员变量都是【私有的】。补充下列程序中的 Student 类以实现上述功能。#include <iostream>#include <string>#include <cstdio>#include <cs...原创 2018-04-15 09:51:08 · 3593 阅读 · 0 评论 -
第二周测验 003:超简单的复数类
总时间限制: 1000ms 内存限制: 65536kB描述下面程序的输出是:3+4i 5+6i请补足Complex类的成员函数。不能加成员变量。#include <iostream>#include <cstring>#include <cstdlib>using namespace std;class Complex {private: do...原创 2018-04-15 10:55:18 · 1382 阅读 · 9 评论 -
第二周测验 004:哪来的输出
总时间限制: 1000ms内存限制: 65536kB描述程序填空,输出指定结果 #include <iostream>using namespace std;class A { public: int i; A(int x) { i = x; }// 在此处补充你的代码};int main(){ A a(1); A * pa = new A(2); delete...原创 2018-04-15 11:04:51 · 1016 阅读 · 0 评论