首页
Python
Java
IOS
Andorid
NodeJS
JavaScript
HTML5
【
cs11_c++_lab4a
】的更多相关文章
cs11_c++_lab4a
SparseVector.hh class SparseVector { private: //结构体不一定会用到,不用初始化 struct node { int index; int value; node *next; node() : index(index), value(value), next(next) {} }; //这些才是真正的数据成员,要初始化的 int size; node *start; void clear(); void copyList(const SparseV…
cs11_c++_lab7
wcount.cc #include <iostream> #include <map> #include <string> #include <algorithm> #include <ctype.h> // So we don't have to type "std::" everywhere... using namespace std; string processWord(string &word); voi…
cs11_c++_lab6
expressions.hh #ifndef EXPRESSIONS_HH #define EXPRESSIONS_HH #include "environment.hh" #include <string> #include <stdexcept> #include <cassert> #include <cmath> using namespace std; class Expression { public: Expression(…
cs11_c++_lab5待修改
heap.hh #ifndef HEAP_HH #define HEAP_HH #include <iostream> #include <stdexcept> #include <cassert> using namespace std; template <typename T, int maxsize>class heap//模板类heap,类型T,常量maxsize { private: int num_values;//当前存储的元素的数量 T v…
cs11_c++_lab4b
SparseVector.hh class SparseVector { private: //结构体不一定会用到,不用初始化 struct node { int index; int value; node *next; node() : index(index), value(value), next(next) {} }; //这些才是真正的数据成员,要初始化的 int size; node *start; void clear(); void copyList(const SparseV…
cs11_c++_lab3
Matrix.hh class Matrix { int row; int col; int *p; void copy(const Matrix &m); void clearup(); public: Matrix(); Matrix(int x,int y); ~Matrix(); Matrix(const Matrix &m); const int getrows() const; const int getcols() const; void setelem(int x,int…
cs11_c++_lab2
Matrix.hh class Matrix { int row; int col; int *p; public: Matrix(); Matrix(int x,int y); ~Matrix(); Matrix(Matrix &m); int getrows(); int getcols(); void setelem(int x,int y,int elem); int getelem(int x,int y); void add(Matrix &m); void subtract(…
cs11_c++_lab1
lab1.cpp #include "Point.hh" #include <iostream> #include <cmath> using namespace std; double computeArea(Point &a, Point &b, Point &c) { double x=a.distanceTo(b); double y=b.distanceTo(c); double z=c.distanceTo(a); ; dou…