首页    新闻    小组    威客    人才    下载    博客    代码贴    在线编程    论坛
代码贴gougoudan的代码贴C++
#include <iostream>
using namespace std;

class FiniteField
{
    int mPrime, mD;
public:
    FiniteField(int ip = 0, int id = 0)
        :mPrime(ip), mD(id)
    {
    }
    void Show()
......................
阅读全部 | 2020年6月17日 15:51
#include <iostream>
using namespace std;

class Point
{
    int x, y;
public:
    //构造函数,
    Point(int ix = 0, int iy = 0)
        :x(ix), y(iy)
    {
        cout << endl << "Point(" << x << "," << y << ") is called!";
......................
阅读全部 | 2020年6月17日 15:31
//StudybarCommentBegin
#include <vector>
#include <iostream>
using namespace std;
int main()
{
    vector<int> arr;
    int i;
    int a;
    for (i = 0; i < 4; i++)
    {
        cin >> a;
......................
阅读全部 | 2020年6月17日 14:51
#include <iostream>
#include <iomanip>
using namespace std;

class Rectangle
{
public:
    Rectangle() :length(1), width(1){}

    void setLength(double a)
    {
        if (0.0 < a && a < 20.0)
......................
阅读全部 | 2020年6月17日 14:38
#include <iostream>
using namespace std;

class Cmytime
{
private:
    int mh, mm, ms;

public:
    void Show()
    {
        cout<< mh << ":"
......................
阅读全部 | 2020年6月17日 14:30
//StudybarCommentBegin
#include <iostream>
#include <cmath>
using namespace std;
class Point
{
protected:
    double x, y;
public:
    Point(double x = 0, double y = 0)
    {
        this->x = x; this->y = y;
......................
阅读全部 | 2020年6月16日 15:37
//StudybarCommentBegin
#include <iostream>
#include <cmath>
using namespace std;
class Point
{
protected:
    double x, y;
public:
    void SetPoint(double x = 0, double y = 0)
    {
        this->x = x; this->y = y;
......................
阅读全部 | 2020年6月16日 15:17
#include <iostream>
using namespace std;

class SomeClass
{
public:
    int ma;
    double mb;
    SomeClass(){}
    SomeClass(int a, double b){ ma = a; mb = b; }
    bool operator==(const SomeClass& k) const
    {
......................
阅读全部 | 2020年6月16日 14:51
//设计一个人物信息描述类,可以分3种级别存储人物信息(普通信息,学生信息,专业学生信息)
//Person,通用人物描述基类,可以存储各职业人物信息。
//Student,学生描述类,可以存储各种学生人物信息。
//Graduate,专业学生描述类,可以存储专业学生人物信息。
//在主函数测试中使用多态方式不同级别的人物信息。

#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<string>
using namespace std;

//创建一个数字基类
......................
阅读全部 | 2020年6月14日 15:47
//设计一个计算图形面积的类库。
//类库的顶层是一个抽象类Shape,并且提供三个纯虚函数;显示数据成员、返回面积和返回体积。
//由Shape类派生Shape2D(二维图形)和Shape3D(三维图形),增加了有关的数据成员
//派生具体的图形类。
//派生Circle(圆)、Rectangle(矩形)。
//在主函数测试中使用多态方式调用不同对象的求值函数。

#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
using namespace std;
const double PI = 3.1415926;

......................
阅读全部 | 2020年6月14日 15:21
上一页 1 2 3 4 下一页
gougoudan