以下程序段PROGRAM MAINEXTERNAL FXY=TX(FX,3,2)PBINT*,YENDFUNCTION TX(FUN,A,B)FX=(FUN(A)-FUN(B))/2.0ENDFUNCTION FX(X)FX=X*XEND程序运动结果为()。
A: 9
B: 4
C: 2.5
D: 6.5
A: 9
B: 4
C: 2.5
D: 6.5
举一反三
- 如下程序的输出结果是___________def fun(): return lambda x,y:x*x+y*y fx=fun() print(fx(3,4))
- 下列程序段输出_______。 int fun(int x) { return (x<3?1:(fun(x-1)+2*fun(x-2))); } int main() { printf("%d",fun(4)+fun(5)); }
- 下列说法不正确的是( )。知识点:全局变量 A: x = 5def fun(): x = 2 x = x * 3 print(x, end=' ')fun()print(x)程序无误,输出结果为6 5 B: x = 5def fun(): global x x = 2 x = x*3 print(x, end=' ')fun()print(x)程序无误,输出结果为6 6 C: x = 5def fun(): x = x * 3 print(x ,end=' ')fun()print(x)程序无误,输出的结果为15 15 D: x = 5def fun(): print(x, end=' ')fun()print(x)程序无误,输出的结果为5 5
- 读程序写结果。()#()include()<stdio.h>()void()main()(){()float()fx()=()12.456;()printf()("%f,()%7f,%7.2f,()%.2f,()%-7.2f\n",()fx,()fx,()fx,()fx,()fx);()}
- 以下程序的输出结果是 ( ) 。# include <;stdio.h>;void fun(int x){if(x/2>;0)fun(x/2);printf("%d",x);}main(){fun(3);printf("\n");}