zoukankan      html  css  js  c++  java
  • 自考新教材-p143_2

    源程序:

    #include <iostream>
    using namespace std;

    class point
    {
    private:
    float x, y;
    public:
    void f1(float a, float b)
    {
    x = a;
    y = b;
    }
    point()
    {
    x = 0;
    y = 0;
    }
    void getx()
    {
    cout << x << endl;
    }
    void gety()
    {
    cout << y << endl;
    }
    friend void print(point);
    };
    void print(point a)
    {
    cout << a.x << "," << a.y << endl;
    }
    int main()
    {
    point a;
    a.f1(3.0,5.0);
    print(a);
    system("pause");
    return 1;
    }

    运行结果:

  • 相关阅读:
    UVA
    UVA
    UVA
    UVA
    UVA
    UVA
    UVA
    UVA
    UVA
    使用Jmeter(三十)针对ActiveMQ JMS POINT TO POINT压力测试(转载)
  • 原文地址:https://www.cnblogs.com/duanqibo/p/12269992.html
Copyright © 2011-2022 走看看