单项选择题
有以下程序:
#include <iostream>
using namespace std;
int main()
int x;
for(int i=1;i<=100;i++)
x=i;
if (++x%2==0)
if (++x%3==0)
if (++x%7==0)
cout<<x<<",";
cout<<end1;
return 0;
执行后输出结果是( )。
A.39,81
B.42,84
C.26,68
D.28,70
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
单项选择题
有如下程序: #include <iostream> using namespace std; class AA public: virtual void f() cout<< AA ; ; class BB : public AA public: BB() cout << BB ; ; class CC : public BB public: virtual void f() BB::f(); cout << CC ; ; int main () AA aa,*p; BB bb; CC cc; p=&cc; p->f (); return 0; 执行上面的程序将输出( )。
A.AA
B.AABBCC
C.BBAABBCC
D.BBBBAACC
点击查看答案&解析
单项选择题
有以下程序: #include <iostream> #include <string> using namespace std; class base private: char baseName[10]; public: base ( ) strcpy (baseName, Base ); virtual char *myName() return baseName; char *className() return baseName; ; class Derived : public base private: char derivedName[10]; public: Derived() strcpy(derivedName, Derived ); char *myName() return derivedName; char *className() return derivedName; ; void showPtr(base &p) cout<<p.myName()<< <<p.className() ; int main () base bb; Derived dd; showPtr(dd) ; return 0;
A.DerivedBase
B.BaseBase
C.DerivedDerived
D.BaseDerived
点击查看答案&解析
相关试题
设文件temp.txt 已存在,则以下的打印结...
有以下程序: #include <iostream> u...
有以下程序: #include <iostream> u...
下面语句段的输出结果是 【10】 。 in...
有如下的类的模板定义: template <clas...