仔细阅读下面的程序,找出类定义中的错误及其理由,并以尽量少的改动写出test的定义,使其能够正确编译运行并给出运行结果。#includeclasstest{intm;intGet{returnm;}public:statictest(inti){m=i;}voidSet(inti){m=i;}voidShow{cout<<get;}~test{cout<<endl<<″out″;}};voidmain{testa;a.Show;a.Set;a.Show;testc;c.Set;c.Show;}A.正确B.错误

题目类型: 问答题

题目内容

仔细阅读下面的程序,找出类定义中的错误及其理由,并以尽量少的改动写出test的定义,使其能够正确编译运行并给出运行结果。#includeclasstest{intm;intGet{returnm;}public:statictest(inti){m=i;}voidSet(inti){m=i;}voidShow{cout<

正确答案

题目纠错