填空题

下列程序的输出结果是______。
#include <iostream.h>
void main()

int i(1),j(2),k(3),a(10);
if(!i)
a--;
else if(j)
if(k) a=5;
else
a=6;
a++;
cout<<a<<endl;
if(i<j)
if(i!=3)
if(!k)
a=1;
else if(k)
a=5;
a+=2;
cout<<a<<endl;

【参考答案】

6
7
<上一题 目录 下一题>
热门 试题

填空题
下列程序的输出结果是______。 #include <iostream.h> void main() int a(5),b(6),i(0),j(0); switch(a) case 5:switch(b) case 5:i++;break; case 6:j++;break; default:i++;j++; case 6:i++; j++; break; default:i++;j++; cout<< , j<<endl;
填空题
下列程序的输出结果是______。 #include <iostream> using namespace std; class Test public: Test()cnt++; ~Test() cnt--; static int Count() return cnt; private: static int cnt; ; int Test::cnt=0; int main() cout<<Test::Count()<<’’; Test t1,t2; Test*pT3=new Test; Test*pT4=new Test; cout<<Test::Count()<<’’; delete pT4; delete pT3; cout<<Test::Count()<<endl; return 0;
相关试题
  • 以下程序的执行结果是______。 #in...
  • 已知:double A(double a)return ++...