填空题

执行如下程序后的输出结果是 【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;
相关试题
  • 若有下面的说明和定义: struct test ch...
  • 有以下程序: #include <iostream> u...
  • 有以下程序: #include <iostream> u...
  • 有以下程序: #include <iostream> u...
  • 对于下面定义的类MyClass,在函数f()中将...