有以下程序
void f(int n, int *r)
{ int r1=0;
if(n%3==0) r1=n/3;
else if(n%5==0) r1=n/5;
else f(--n,&r1);
*r=r1;
}
main( )
{ int m=7,r;
f(m,&r); printf("%d\n",r);
}
程序运行后的输出结果是
A) 2
B) 1
C)3
D) 0
有以下程序 void f(int n,int *r) { int r1=0; if(n%3==0) r1=n/3; else if(n%5==0) r1=n/5; else f(--n,&r1); *r=r1; } main() { int m=7,r; f(m,&r);printf("%d",r); } 程序运行后的输出结果是
A.2
B.1
C.3
D.0
有如下程序,运行时输出的结果是 ______。 Option Base 1 Private Sub Command1_Click() Dim a(3,3) As Integer For m=1 To 3 For n=1 To 3 a(m-1,n-1)=m+n+1 Next n Next m For m=0 To 2 For n=0 To 2 Print a(n,m); Next n Print Next m End Sub
A.0 1 2 1 2 3 2 3 4
B.3 4 5 4 5 6 5 6 7
C.1 3 5 3 5 7 5 7 9
D.2 4 6 4 6 8 6 8 10
以下程序的输出结果是 #include<stdio.h> in[fun(int n,int *s) {int n,f2; if(n==0‖n==1) *s=1; else {fun(n-1,&f1); fun(n-2,&f2); *s=f1+f2; }} void main() { int x; fun(6,&x); pfintf("\n%d",x);}
A.7
B.13
C.9
D.10
A、f(1)=0
B、f(1)=1
C、f(0)=1
D、f(n)=f(n-1)+1/n
69/6L IP315N-$1*=315LFN-$1*69B /A 69B 69/6!WFPE69B 631 QQ 915446173 N1E/31MCz - QGCz(yv?y0 1 “67IP640FV=315N-$1*=315LFN-$1*69B 0A/A E2 WE QQ= QQ5=E2*#A = YYB#N)?N1 FPE)Q 69 #wA http:/ 3A1peDE,IPeCzr“j69B 2012 A 315N-$1*69B B N 1 -69/6L N.J0c 5L 1b6 p69B 0-$52 .A 75F F?N“N 13+5N-G+X #0 ;#=!.,_ 1 AO8CO,=1*+ m +mG C-(-$ogP ,6 E0A FPE 2 XE .G+m WL )AF,#B Beta#B E,P+m L+)AF,#B #B /6.,L.,4,F*oL$C D-*5A=+k“? OB4,gFPE#B E,c#B F6eB#F(#q v_0ZK.-(#qx,L v) (G 9W,= vp9,= | 8 1*60K.x_CWk,(#qxL v A(#q6- B19(#q C1 (#q D(#q0 F K1L C KL !N69,e+k(#wN-$“ ENNO!W69 +k |(#w WEq?=8 pp2 G=%CN?“xp=9 315q-6N L,F8)/tP5# , WE ;“8 :(#w=(#w6-=1b?(#w=1b (#w (#w6 L0E 8 :(#we7P8 D5:(#wq? +k |PP:B8,UF,+k |7P ? WC+k |,7PPF?+8 :(#w,E7P8 :(#w WEE -v+k | 7P8 40(#wGF73155:1* (#w6-elFVP=K6 d7P=(#w7P0!E,-. A6B01,60(#w 31 6-,7P“L=L56(#wCz$BA B_- B, 7P7 :8 ,)“1(#w6-pEf“ )“(#w#q *, 7PL*F-. 1=OL=l-,(#wOj31 1b?(#w Third- Party Logistics,10, K4 L 315 Le 1b?(#w,0.v C,(#w WE 4M0“r68j+e v51 f,k7-M0“r; .p/j+e vJ51 , 7-M0“r;MB$#=!.,_ 4 A1Jg Zg X# = Ct -(+0 BZg X# = 3 “r C1Jg X# = 31 1 DB+e v51 =315LFN-$1*69B /A 69B 69/6!WFPE69B 631 QQ 915446173 N1E/31MCz - QGCz(yv?y0 3 “67IP640FV=315N-$1*=315LFN-$1*69B 0A/A E2 WE QQ= QQ5=E2*#A = YYB#N)?N1 FPE)Q 69 #wA http:/ 55m 55m # D % Cz -.+6 !7Pm m # D % Cz -.+6 E+|l6_0/h+X,U-#B#0;)0A| 0!Q0J| 100!QG +XE+|l6#F9 5j#B+X A) 0!Q) 1!Q) 99!Q) 100!Q B) 0!Q) 100!Q) 49!Q) 50!Q C) 1!Q) 99!Q) 49!Q) 50!Q D) 0!Q) 100!Q K1L A KL !N69,eE,#B NQN69A-63 AD5SA-DXA .G6 ; 90+e:0/.;A-ENQ-62AA-DAA-2D92/.2D*2D-B?- / 8Q3/=),(D 7E 0;4 +N-4*6,+b! X0 B E IG- X0 E,5jL)“d;p/jj ABE2 5jL) +b I 3+50; Q Q 0; Q Q AB3+bI, 48 X)5F,.1*.p:550 B5$10 +6=
以下程序的输出结果是( )。 #include<stdio.h> int fun(int n,int *s) { int f1,f2; if(n==0||n==1) *s=1; else { fun(n-1,&f1); fun(n-2,&f2); *s=f1+f2; } } void main() { int x; fun(6,&x); printf("\n%d" ,x);}
A.7
B.13
C.9
D.10
有以下程序
#inculde <stdio.h>
int F(int t[],int n);
main()
{ int a[4]=(1,2,3,4),s;
s =F(a,4);printF(“%d\n”,s);
}
int F(int t[],int n)
{ iF(n>0) return t[n-1]+F(t,n-1);
Else return 0;
}
程序运行后的输出结果是
A.4
B.10
C.14
D.6
F(n)=1 n>8 n<12
F(n)=2 n<2
F(n)=3 n=6
F(n)=4 n=other
使用+ - * /和 sign(n)函数组合出 F(n)函数
sign(n)=0 n=0
sign(n)=-1 n<0
sign(n)=1 n>0
以下程序段的执行结果是 ______。 Dim A(3, 3) For m = 1 To 3 For n = 1 To 3 If n = m Or n = 3 - m + 1 Then A(m, n) =m + n Else A(m, n) = 0 End If Next n Next m For m = 1 To 3 For n = 1 To 3 Print A(m, n); Next n Print Next m
A. 1 1 1 1 1 1 1 1 1
B.2 0 4 0 4 0 4 0 6
C.0 0 0 0 0 0 0 0 0
D.1 0 1 0 1 0 1 0 1
有以下程序: void f(int n,int * r) {int r1=0; if(n%3==0)r1=n/3; else if(n%5==0)r1=n/5; else f(--n,&r1); *r=r1;} main() {intm=7,r; f(m,&r);printf("%d\n",r);} 程序运行后的输出结果是______。
A.2
B.1
C.3
D.0