• 2022-05-31
    以下程序段的输出结果为( ) Dim a(10),p(3) k=5 For i=0 To 10 a(i)=i Next i For i=0 To 2 p(i)=a(i+(i+1)) Next i For i=0 To 2 k=k+p(i)+2 Next i Print k
    A: 20
    B: 21
    C: 56
    D: 32
  • A

    内容

    • 0

      下列程序的输出结果是______。 main () int i, k, ai[0], p[3]; k=5; for (i=0;i<10;i++) a[i]=i; for (i=0;i<3;i++) p[i]=a[i*(i+l)]; for (i=0;i<3;i++) k+=p[i]*2; printf ("%d\n", k);[/i][/i][/i] A: 20 B: 21 C: 22 D: 23

    • 1

      下列程序的执行结果是____。 K=0 For I=1 To 3 a=I^I^K print a; Next I

    • 2

      下列程序的执行结果是______。 k =0 For i=1 To 3 a = i ^ i ^ k Print a; Next I A: 1 1 1 B: 1 2 3 C: 0 0 0 D: 1 4 9

    • 3

      有以下程序main(){ int p[7]= {11,13,14,15,16,17,18},i=0,k=0; while(i<7 & & p[i] %2) { k= k+ p[i];i+ +;} cout<<k<<end1;}执行后输出结果是[/i][/i] A: 58 B: 56 C: 45 D: 24

    • 4

      写输出下面程序的运行结果_ _。 Dim a() As Integer Private Sub Command1_Click() ReDim a(1 To 5) For i = 1 To 5 a(i) = i Next i ReDim a(1 To 10) For i = 6 To 10 a(i) = 2 * i Next i For i = 1 To 10 Print a(i); Next i End Sub