填空题

执行如下程序后的输出结果是 【15】 。 #include <iostream> #include <fstream> using namespace std; int main ( ) { char s[25]; ofstream fl("data.txt"); f1<<"C++ Programming"; f1.close (); ifstream f2 ("data.txt"); if (f2.good()) f2>>s; f2.close(); cout<<s; return 0; }

【参考答案】

C++
<上一题 目录 下一题>
热门 试题

填空题
有以下程序:#include <iostream>using namespace std;class Base{int a;public:Base(int x) { a-x; }void show() { cout<<a; }};class Derived : public Base{int b;public:Derived(int i) :Base(i+1)void show() { cout<<b; }};int main ( ){Base b(5) ,*pb;Derived d(1);pb=&d;pb->show ();return 0;}运行后的打印结果是 【14】 。
填空题
在下面程序的横线处填上适当的语句,使该程序执行结果为10。#include <iostream>using namespace std;class MyClass{public:MyClasS(int A){X=a;}【13】 取x的值private:int x;};int main(){ MyClass my(10);cout<<my.GetNum()<<end1;return 0;}
相关试题
  • 结构化程序设计的一种基本方法是( )。
  • 在重载一个运算符函数时,其参数表中没有任...
  • 在“int a=10,*p=&a;”语句中,p...
  • 对建立良好的程序设计风格,下面描述正确的...
  • 在软件生命周期中,能准确地确定软件系统必...