趋势科技2017校招开发岗试题(B)
时长:90分钟 总分:100分
224浏览 0人已完成答题
题型介绍
题型 | 单选题 | 简答题 |
---|---|---|
数量 | 20 | 5 |
以下程序输出结果是 ? #include <iostream> using namespace std int main() { int x = 2, y, z x *= (y=z=5) z = 3
#include <iostream> using namespace std
int main() { int x = 2, y, z x *= (y=z=5) z = 3 x += (y & z) x += (y && z) cout << x << endl return 0 }
以下程序输出值是?
#include <stdio.h> #define f(a,b) a+b #define g(a,b) a*b int main(int argc, char **argv) { int m m=2*f(3,g(4,5)) printf("\n m is %d\n",m) }
请问在main函数中用户自定义类的默认构造函数总共被调用了几次?
#include <iostream> using namespace std
class Animal { public: Animal() { } virtual void eat() { cout << "Animal" << "eat" << endl } }
class Mammal : public virtual Animal { public: Mammal() {} virtual void breathe() {} virtual void eat() { cout << "Mammal" << "eat" << endl } }
class WingedAnimal : public virtual Animal { public: WingedAnimal() { } virtual void flap() {} virtual void eat() { cout << "WingedAnimal" << "eat" << endl } } class Bat : public Mammal, public WingedAnimal { public: Bat() { }
virtual void eat() { cout<<"Bat"<<" eat"<<endl } } int main() { Bat b WingedAnimal bb Animal &a = b
Animal &aa = bb aa.eat()
return 0 }
写出伪代码,实现进程调度,使所有进程(P)可以顺利执行完毕。 程序中参数如下: P - 进程的集合; Mp - 进程p的最大的请求资源; Cp - 进程p当前被分配的资源; A - 当前可用的资源。
程序中参数如下:
P - 进程的集合;
Mp - 进程p的最大的请求资源;
Cp - 进程p当前被分配的资源;
A - 当前可用的资源。
在一个请求页式存储管理中,一个程序的页面走向为4, 3, 2, 1, 3, 5, 4, 3, 2, 1, 5,并采用LRU算法。假设分配给该程序的存储块M分别为3和4,则该访问中发生的缺页次数F分别是?
以下程序的输出结果是? #include <stdio.h> main() { char a[10]={ ‘1’,‘2’,‘3’,‘4’,‘5’,‘6’,‘7’,‘8’,‘9’,0},*p int i i=8
#include <stdio.h> main() { char a[10]={ ‘1’,‘2’,‘3’,‘4’,‘5’,‘6’,‘7’,‘8’,‘9’,0},*p int i i=8 p=a+i printf("%s\n",p-3) }
若有以下C函数调用语句: f(m+n,x+y,f(m+n,z,(x,y))) 在此函数定义中, f有多少个参数?
f(m+n,x+y,f(m+n,z,(x,y)))
以下代码中, 类A的构造函数和析构函数分别执行了几次?() A *pa = new A[5] delete pa
A *pa = new A[5] delete pa