题目内容

写出下面的程序的运行结果#include #define N 5void func(){static int a;int b=2;cout<<(a+=3,a+b)<<” ”;}void main(){for(int i=1;i

查看答案
更多问题

写程序运行结果#include using namespace std;class goods {private: static int totalweight;int weight;public: goods(int w) { weight=w; totalweight+=weight; }goods(goods &gd) { weight=gd.weight; totalweight+=weight; }~goods() { totalweight-=weight; }static int gettotal() { return totalweight; }};int goods::totalweight=0;void main() {goods g1(50);cout<

写程序运行结果#include using namespace std;class A{int i,j;static int c;public:A(int a=0,int b=0) { i=a; j=b; c++; }~A() { c--; }static void f() { cout<

写程序运行结果#include using namespace std;class point {public:void poi(int px=10,int py=10){ x=px; y=py; }friend int getpx(point a);friend int getpy(point b);private:int x,y;};int getpx(point a){return a.x;}int getpy(point a){return a.y;}void main(){point p,q;p.poi();q.poi(15,15);cout<

写程序运行结果#include class R{int R1,R2;public:R(int r1,int r2){R1=r1;R2=r2;}void print(){cout<<"void print()"<

答案查题题库