请问为什么下面这题答案是D而不是C?What is the output of the following code fragment?(All variables are of type int.)alpha = 3; beta = 20; if (beta > 10) { int alpha = 5; beta = beta + alpha; cout

来源:学生作业帮助网 编辑:作业帮 时间:2024/09/09 02:40:21
请问为什么下面这题答案是D而不是C?What is the output of the following code fragment?(All variables are of type int.)alpha = 3; beta = 20; if (beta > 10) { int alpha = 5; beta = beta + alpha; cout
xݑN@_.!64(%FT[hRۦ4 D!,45&H\EV|)+_VIqg̹ܹH_kjlxv۞=^Njv3ٰw@K*Xej)X*2 k_7mpjBb0`8:Q q`t5I D bwtt (eXK'2w49>L%I  AAʗo_GS,_յЫs1Zf;ُ؟F9ɅD!eS^)}:GgPJ61sgm1

请问为什么下面这题答案是D而不是C?What is the output of the following code fragment?(All variables are of type int.)alpha = 3; beta = 20; if (beta > 10) { int alpha = 5; beta = beta + alpha; cout
请问为什么下面这题答案是D而不是C?
What is the output of the following code fragment?(All variables are of type int.)
alpha = 3;
beta = 20;
if (beta > 10)
{
int alpha = 5;
beta = beta + alpha;
cout

请问为什么下面这题答案是D而不是C?What is the output of the following code fragment?(All variables are of type int.)alpha = 3; beta = 20; if (beta > 10) { int alpha = 5; beta = beta + alpha; cout
if里面的alpha是局部变量,alpha=5;下面得alpha是全局变量3;输出就是3,25了;
复习下全局,局部变量的章节