C++对C的扩充
从C到C++
Interesting1024
C CPP
展开
-
友元friend
instance analysis1: #include<iostream> #include<cmath> using namespace std; class Point; class ManagerPoint { public: double Distance(Point &a, Point &b); }; class Point { public: Point(double xx, double yy) { x = xx; y原创 2020-10-27 21:32:28 · 138 阅读 · 0 评论 -
srand随机生成数
instance analysis1: #include <iostream> #include <vector> #include <time.h> #include <stdlib.h> using namespace std; int main() { srand(time(NULL)); for(int i = 0; i < 10;i++ ) cout << rand() <<原创 2020-10-27 20:21:28 · 128 阅读 · 0 评论