在一个程序中有两个源文件main.cpp和funcs.cpp,main.cpp内容如下:#includevoid main(){int imax(int,int);int abc=123;printf("%d\n", imax(abc, 101));}int abc=321;以下描述错误的是_____
A. funcs.cpp的内容如下:int imax(int a, int b){return a>b?a:b;}本程序的输出是:123
B. funcs.cpp的内容如下:extern int abc;int imax(int a, int b){return a>abc?a:abc;}本程序的输出是:321
C. funcs.cpp的内容如下:extern int abc=111;int imax(int a, int b){return a>abc?a:abc;}本程序的输出是:123
D. funcs.cpp的内容如下:extern int abc;int imax(int a, int b){abc=121;return a>abc?a:abc;}本程序的输出是:123
查看答案
某程序包含以下两个源文件,以下描述错误的是_____源文件main.cpp:#includeint a=4;int getMin(int, int);void main(){int e=10;printf("%d, %d\n", a, getMin(a, e));}int f[5]={0,1,2,3,4};源文件funcs.cpp:#includeint getMin(int aa, int bb){extern int f[];return aa>bb?f[0]:bb;}
A. 整型变量a和数组f属于外部变量
B. 在main函数中不可以访问外部变量f
C. 当函数getMin被调用时,形参aa, bb和变量f都将会被分配内存,调用结束后,它们的内存都将被回收
D. 当函数getMin被调用时,形参aa, bb会被分配内存,而变量f不会
1 #include2 void main(){3extern int b;4int a=17;5{int a=9; b-=a;}6printf("%d, %d\n", a, b);7 }8 int b=11;以下描述正确的是_____
A. 该程序运行后的输出是:17, 2
B. 该程序运行后的输出是:9, 2
C. 变量b的作用域是从其定义的地方开始,即第8行,到文件结束
D. 此程序有错,第4行和第5行的变量a有重定义错误
以下关于作用域的相关描述错误的是_____
A. 名字(变量和函数)的作用域指的是程序中可以使用该名字的部分
B. 外部变量的作用域是从声明它的地方开始,到其所在的文件的末尾结束
C. 局部变量的作用域是从声明它的地方开始,到其所在的文件的末尾结束
D. 函数的作用域是从声明它的地方开始,到其所在的文件的末尾结束
Will you be a worker or a laborer?The text argues, by differentiating among work, labor, and play, that interest and __1_______ in work are important for the benefit of both _____2_____ and society.There are three major differences between workers and laborers. Firstly, workers and laborers are different in their ___3____ toward their work. Workers will dedicate more time to workingand spend less time on leisure,whereas laborers will regard leisure as ___4_______ from compulsion and the more hours they have free for play, the better. Secondly, workers and laborers differ in the amount of _______5____ they derive from their jobs. Workers will achieve greater ___6________ than laborers. Thirdly, in modern times, workers and laborers spend their leisure timein different ways.While social development has created much more leisure time than ever before, modern laborers spend their leisure time in fostering bad habits. Considering this phenomenon, _____7__________ can make the difference between being bored, unhappy laborers and workers who find meaning and joy in their _____8______ and life.Moreover, workers, unlike laborers, hurl their ___9______ into their work, be it physical or mental.Everyone has to find a job andearn a living, and that whateverjob you choose, you must ____10________ this essential question: Will you be a laborer or a worker?