题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2023-10-22 14:30:00

[填空题]下面程序运行时输出结果为______。
#include <iostream.h>
#include <malloc.h>
class Rect

public:
Rect(int l,int w) length=l;width=w;)
void Print( ) cout<<"Area:"<<length*width<<endl;
void *operator new(size-t size) return malloc(size);
void operator delete(void *p)free(p
private:
int length,width;
;
void main( )

Rect *p;
p=new Rect(5,4);
p->Print( );
deletep;

更多"下面程序运行时输出结果为______。 #include <iost"的相关试题:

[填空题]下列程序的输出结果是______。 #include <iostream> #include <cstring> using namespace std; void fun(const char*S,char &C) {e=s[strlen(s)/2];} int main( ){ char str[ ]="ABCDE"; char ch=str[1]; fun(str,ch); cout<<ch; return 0; }
[填空题]下面程序运行时输出结果为:
C:/Program Files is a directory.
请将程序补充完整。
import java.io*;
public class DirTest
public static void mian (String[]args)
File myDir=new File ("C:/Program Files/");
System.out.printIn (myDir+(______.isDirectory( )"is": "is not")+"a directory.");


[填空题]以下程序运行后的输出结果是 【16】 。 #include <stdio, h> #include <stating, h> void fun(char * s,int p,int k) { int i; for(i=p;i<k-1;i++) s[i] =s[i+2]; } main( ) { char s [] = "abedefg"; fun(s,3 ,strlen(s) ); puts(s); }
[填空题]以下程序执行后输出的结果是 【15】 。 #include<iostream> #include<fstream> using namespace std; int main( ){ ofstream ofile("D://temp.txt"); if(!ofile){ cout<<"temp.txt cannot open"<<endl; return 0; } ofile<<"This is a book" <<" " <<54321<<endl; ofile.close( ); ifstream ifile("D://temp.txt"); if(!ifile){ cout<<"temp.txt cannot open" <<endl; return 0; } charstr[40]; ifile >> str; ifile.close( ); cout<<Str<<endl; return 1; }
[填空题]下面程序运行时输出的结果为 C:/Program Files is a directory. 将程序补充完整。 Import java.io.*; public class DirTest {  public static void main(String[] args) {   File myDir=Flew File("C:/Program Files/");   System.out.println(myDir+(______.isDirectory( )"is":"is not")+"a directory.");  } }
[填空题]下面程序运行时输出结果为 【8】 。 #include<iostream.h> #include<malloc.h> class Rect { public: Rect(int1,int w)(length=1;width=w;) void Print( ){cout<<"Area:"<<length *width<<endl;) void *operator new(size-t size){return malloc(size);} void operator delete(void *p){free(p) private: int length,width; }; void main( ) { Rect*p; p=new Rect(5,4); p->Print( ); delete p; }
[填空题]下面程序运行时输出的结果为
C:/Program Files is a directory.
将程序补充完整。
Import java.io.*;
public class DirTest
 public static void main(String[] args)
  File myDir=Flew File("C:/Program Files/");
  System.out.println(myDir+(______.isDirectory( )"is":"is not")+"a directory.");
 

[填空题]下面程序运行时输出结果为 【8】
#include<iostream.h>
#include<malloc.h>
class Rect

public:
Rect(int1,int w)(length=1;width=w;)
void Print( )cout<<"Area:"<<length *width<<endl;)
void *operator new(size-t size)return malloc(size);
void operator delete(void *p)free(p)
private:
int length,width;

void main( )

Rect*p;
p=new Rect(5,4);
p->Print( );
delete p;

[填空题]下面程序运行时输出结果为______。
#include<iostream.h>
#include
class Rect
{
public:
Rect(int l, int w){length=l; width=w;)
void Print( ){cout<<"Area:"<<length*width<<end1;}
void operator delete(void*p){free(p);}
private:
int length, width;
};
void main( )
{
Rect *p;
p=new Rect(5, 4);
p->Print( );
delete p;
}
[填空题]下面程序运行时输出结果为______。
#include<iostream.h>
#include
class Rect

public:
Rect(int l, int w)length=l; width=w;)
void Print( )cout<<"Area:"<<length*width<<end1;
void operator delete(void*p)free(p);
private:
int length, width;
;
void main( )

Rect *p;
p=new Rect(5, 4);
p->Print( );
delete p;

[填空题]若下面程序运行时输出结果为: 1,A,10.1 2,B,3.5 请将程序补充完整。 #include<iostream> using namespace std; int main( ) { void test(int, char,double______); test(1, ’A’, 10.1); test(2, ’B’); return 0; } void test(int a, char b, double c) { cout<<a<<’,’<<b<<’,’<<c<<end1; }
[填空题]若下面程序运行时输出结果为:
1,A,10.1
2,B,3.5
请将程序补充完整。
#include<iostream>
using namespace std;
int main( )

void test(int, char,double______);
test(1, ’A’, 10.1);
test(2, ’B’);
return 0;

void test(int a, char b, double c)

cout<<a<<’,’<<b<<’,’<<c<<end1;

[简答题]给出下面程序输出结果。
#include<iostream.h>
class Base
private:
int Y;
public:
Base(int y=0)y=y;cout<<"Base("<<y<<")/n";
~Base( )cout<<"~Base( )/n";
void print( )cout<<Y<<" ";

class Derived:public Base
private:
int Z;
public:
Derived(int y,int z):Base(y)
Z=z;
cout<<"Derived("<<y<<","<<z<<")/n";

~Derived( )cout<<"~Derived( )/n";
void print( )
Base::print( );
cout<<Z<<endl;


void main( )
Derived d(10,20);
d.print( );

[单项选择]给出下面程序输出结果。
#include<iostream.h>
void main( )
int *p1;
int**p2=&p1;
int b=20;
p1=&b;
cout<<**p2<<endl;

我来回答:

购买搜题卡查看答案
[会员特权] 开通VIP, 查看 全部题目答案
[会员特权] 享免全部广告特权
推荐91天
¥36.8
¥80元
31天
¥20.8
¥40元
365天
¥88.8
¥188元
请选择支付方式
  • 微信支付
  • 支付宝支付
点击支付即表示同意并接受了《购买须知》
立即支付 系统将自动为您注册账号
请使用微信扫码支付

订单号:

截图扫码使用小程序[完全免费查看答案]
请不要关闭本页面,支付完成后请点击【支付完成】按钮
恭喜您,购买搜题卡成功
重要提示:请拍照或截图保存账号密码!
我要搜题网官网:https://www.woyaosouti.com
我已记住账号密码