注意:此页面搜索的是所有试题
[应用题,25分]
请在横线中填入程序,完成如下PID控制仿真程序. (注意符号、标点符号、括号用半角)

#include
class AAA
{
int A,B;
public:
AAA()
{A=100;B=200;
cout<<"deflat constructing\n";
}
AAA(int i,int j)
{A=i,B=j;
cout<<"constructing\n";}
~AAA(){cout<<"destructing\n";}
void print( )
{cout<<><><><"\n";}>
friend int add(AAA &s1);
};
int add(AAA &s1)
{return (s1.A+s1.B);}
void main()
{AAA a1,*a2;
int s;
a2=new AAA(5,6);
a1.print();
a2->print();
s=add(*a2);
cout<<”s=”<<><>
delete a2;
}
运行结果是:

参考答案