输入
1 2 1
输出
2,2,4
#include<iostream>
using namespace std;
class point
{
int X;
int Y;
public:
static int Countp;
point(int x = 0, int y = 0)
{
X = x;
Y = y;
Countp++;
}
point( const point &p)
{
X = p.X;
Y = p.Y;
Countp++;
}
~point()
{
Countp--;
}
friend point myfun(point p1, point p2, point p3);
void playshow()
{
cout << X << "," << Y << ",";
}
};
point myfun(point p1,point p2,point p3)
{
point tmp(p1.X+p2.X+p3.X,p1.Y+p2.Y+p3.Y);
return tmp;
}
int point::Countp = 0;
int main()
{
int a, b, c;
cin >> a >> b >> c;
point pp0, pp1(a,b), pp2(c);
point p = myfun(pp0, pp1, pp2);
p.playshow();
cout << point::Countp << endl;
}
0.0分
2 人评分
C语言程序设计教程(第三版)课后习题9.6 (C语言代码)浏览:597 |
C二级辅导-进制转换 (C语言代码)浏览:750 |
企业奖金发放 (C语言代码)浏览:2462 |
简单的a+b (C语言代码)浏览:473 |
C二级辅导-等差数列 (C语言代码)浏览:831 |
C语言训练-斐波纳契数列 (C语言代码)浏览:540 |
C二级辅导-阶乘数列 (C语言代码)浏览:671 |
C语言程序设计教程(第三版)课后习题5.5 (Java代码)浏览:563 |
发工资咯 (C语言代码)浏览:815 |
简单的a+b (C语言代码)浏览:443 |