下面程序运行时输出结果为【 】。
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;
}
第3题
(11 )下面程序运行时输出结果为
C:\Program Files is a directory
请将程序补充完整。
import Java.io.*;
public class DirTest{
public static void main(String[] args){
File myDir = new File(" C:/Program Files/ " );
System.out.println
(myDir + (【 11 】 .isDirectory() ? " is " : " is not " ) + " a directory. " );
}
}
第5题
若下面程序运行时输出结果为
1, A, 10.1
2, B, 3.5
请将程序补充完整 。
#include
using namespace std;
int main()
{
void test(int, char,double 【 8 】 );
test(1,'A',10.1);
test(2,'B');
return 0;
}
void test(int a, char b, double
C .
{
cout<
}
第6题
A.编译不通过
B.运行时出错
C.输出3
D.输出2
为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!