![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++
R_Misaya
这个作者很懒,什么都没留下…
展开
-
SDUT OJ 2862 勾股定理
#includeusing namespace std;int a[1010];void qsort(int a[],int l,int r){ int x=a[l],i=l,j=r; if(l>=r) return ; while(i<j) { while(i=x) j--; a[i]=a[j]; while(i<j&&a[i]<=x) i++; a[j]=a[原创 2014-10-26 11:24:47 · 1067 阅读 · 0 评论 -
SDUTOJ 2677 4-1 复数类的运算符重载
#includeusing namespace std;class Complex{public: Complex(){real=0;imag=0;} Complex(double r,double i){real=r;imag=i;} Complex operator+(Complex &c2); Complex operator-(Complex &c3); void dis原创 2014-10-12 22:38:34 · 1165 阅读 · 0 评论 -
SDUTOJ 2711 4-2 电子时钟中的运算符重载
#include#includeusing namespace std;class Time{private: int h, m, s;public: Time(); Time(int,int,int); void display(); void tick(); Time operator ++(); bool operator原创 2014-10-14 18:33:33 · 1169 阅读 · 0 评论 -
priority_queue<int,vector<int>,greater<int>>优先队列 按照由小到大顺序
C++优先队列的基本使用方法 #include #include #include using namespace std; struct node { friend bool operator< (node n1, node n2) { return n1.priority "为从小打到排列 } int priorit转载 2014-11-02 20:24:19 · 1071 阅读 · 0 评论 -
SDUTOJ 2678 5-1 继承与派生
#includeusing namespace std;class point{private: float x, y;public: point(){x=0;y=0;} point(float,float); void Move(float xOff, float yOff); float GetX(); float GetY();};原创 2014-10-16 23:04:25 · 758 阅读 · 0 评论 -
SDUTOJ 2712 5-2 派生类的构造函数
#include#includeusing namespace std;class Person{protected: char sex; int age; string name;public: Person(string nam,char s,int a) { name=nam; sex=s; age=a; }};class Employee:publi原创 2014-10-17 11:09:02 · 780 阅读 · 0 评论 -
SDUTOJ 2713 5-3 多级派生类的构造函数
#include#includeusing namespace std;class Person {protected: string name; int age; char sex;public: Person(string nam, char s,int a) { name=nam; age=a; sex=s; } void display() {原创 2014-10-17 11:46:48 · 788 阅读 · 0 评论