s=0for i in range(1,5): m=1 for j in range(1,i+1): m=m*j s=s+mprint(s)程序运行结果是:( )
A: 15
B: 24
C: 33
D: 120
A: 15
B: 24
C: 33
D: 120
举一反三
- 下列程序中输出结果为5050的是 A: s=0for i in range(100,-1): s=s+iprint(s) B: s=0for i in range(100,1,-1): s=s+iprint(s) C: s=0for i in range(100): s=s+iprint(s) D: s=0for i in range(101): s=s+iprint(s)
- 写出下面代码的运行结果( )def myfun( i ): s = 1 for k in range(1,i+1): s = s * k return sprint(myfun( 5)) A: 15 B: 150 C: 120 D: 0
- 执行下列程序段后,程序的运行结果为()。 s = 1 For i = 1 To 3 For j = 0 To i - 1 s = s + s * j Next j Print s; Next i
- 执行下面程序段后,输出的结果为( )。 Dim m(5) As Integer s = 0 For i = 0 To 5 m(i) = 5 Next i For j = 0 To 5 s = s + m(j) Next j Print s
- 写出以下程序的运行结果:int main(){ int m,s,i; for(m=6;m<8;m++){ s=0; for(i=1;i<m;i++) if((m%i)==0) s=s+i; if(s==m) printf(“%d”,m);}return 0;}