填空题
下面程序的运行结果为
【13】
。
#include <iostream.h>
void main()
unsigned char value=127;
int total=100;
value++;
total+=value;
cout<<total<<end1;
A) 227
B) 100
C) 127
D) 27
【参考答案】
4 10
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
填空题
有如下程序: #include <iostream> using namespace std; class shapes protected: int x,y; public: void setvalue(int d, int w=0) x=d; y=w; virtual void disp()=0; ; class square : public shapes public: void disp() cout<<x*y<<end1; ; int main() shapes *ptr; square s1; ptr=&s1; ptr->setvalue(10,5); ptr->disp(); return 0; 执行上面的程序将输出 【14】 。
点击查看答案&解析
填空题
有以下程序: #include <iostream> #include <fstream> using namespace std; int main() fstream file; file.open( abc.txt , ios_base::in); if (! file ) cout<< Can not open abc.txt <<end1; abort(); char ch; int i = 0; while ( ! file.eof() ) file.get(ch); i++; cout<< Characters : <<i<<end1; file.close(); return 0; 程序实现的功能是 【15】 。
点击查看答案&解析
相关试题
下列关于类与对象的说法中,不正确的是( )。
下列各种调试方法中,靠演绎、归纳以及二分...
若a,b,c1,c2,x,y均是整型变量,正确...
设树T的度为4,其中度为1,2,3,4的...
基类中的( )不允许外界访问,但允许派生...