下面程序运行时输出结果为______。
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;
}
第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<
}
第8题
A.编译不通过
B.运行时出错
C.输出3
D.输出2
为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!