【单选题】下面程序执行结果() #include main() { int i ,j ; for(i=1; i<=5; i++) { for(j=1; j<=i; j++) printf("%2d",i); printf(" ",); } } A. 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 B. 1 2 3 4 5 C. 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 D. 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
【单选题】下面程序执行结果() #include main() { int i ,j ; for(i=1; i<=5; i++) { for(j=1; j<=i; j++) printf("%2d",i); printf(" ",); } } A. 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 B. 1 2 3 4 5 C. 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 D. 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
下列程序段的执行结果为 _______。 Dim a(3, 5) As Integer Dim i As Integer, j As Integer For i = 1 To 3 For j = 1 To 5 a(i, j) = a(i - 1, j - 1) + (i - 1) * 5 + j Next j Next i Print a(3, 4)
下列程序段的执行结果为 _______。 Dim a(3, 5) As Integer Dim i As Integer, j As Integer For i = 1 To 3 For j = 1 To 5 a(i, j) = a(i - 1, j - 1) + (i - 1) * 5 + j Next j Next i Print a(3, 4)
以下程序的运行结果是。#include<stdio.h>voidmain(){inta[4][5]={1,2,4,-4,5,-9,3};intb=0,i,j,i1,j1,n=-9;for(i=0;i<4;i++){for(j=0;j<5;j++)if(a[i][j]==n){i1=i;j1=j;b=1;break;}if(b)break;}printf("%d是第%d个元素\n",n,i1*5+j1+1);}
以下程序的运行结果是。#include<stdio.h>voidmain(){inta[4][5]={1,2,4,-4,5,-9,3};intb=0,i,j,i1,j1,n=-9;for(i=0;i<4;i++){for(j=0;j<5;j++)if(a[i][j]==n){i1=i;j1=j;b=1;break;}if(b)break;}printf("%d是第%d个元素\n",n,i1*5+j1+1);}
产生并输出如下形式的方阵。 1 2 2 2 2 2 1 3 1 2 2 2 1 4 3 3 1 2 1 4 4 3 3 3 1 4 4 4 3 3 1 5 1 4 4 3 1 5 5 5 1 4 1 5 5 5 5 5 1 #include "stdio.h" int main() { int a[7][7],i,j; for(i=0;i<7;i++) for(j=0;j<7;j++) if( (1) || i+j==6) a[i][j]=1; else if ( (2) &&i+j<6) a[i][j]=2; else if (i>j&&i+j<6) a[i][j]=3; else if (i i==j ; j==i ii i+j>6; j+i>6; 6
产生并输出如下形式的方阵。 1 2 2 2 2 2 1 3 1 2 2 2 1 4 3 3 1 2 1 4 4 3 3 3 1 4 4 4 3 3 1 5 1 4 4 3 1 5 5 5 1 4 1 5 5 5 5 5 1 #include "stdio.h" int main() { int a[7][7],i,j; for(i=0;i<7;i++) for(j=0;j<7;j++) if( (1) || i+j==6) a[i][j]=1; else if ( (2) &&i+j<6) a[i][j]=2; else if (i>j&&i+j<6) a[i][j]=3; else if (i i==j ; j==i ii i+j>6; j+i>6; 6
下列程序: Option Base 1 Private Sub Form_Click() Dim a(5,5) For i = 1 To 5 For j = 1 To 5 k = k + 1 a (i,j)= k Next j Next i For i = 1 To 5 s = s + a (i,i) Next i Print s End Sub 运行时的输出结果是( )。
下列程序: Option Base 1 Private Sub Form_Click() Dim a(5,5) For i = 1 To 5 For j = 1 To 5 k = k + 1 a (i,j)= k Next j Next i For i = 1 To 5 s = s + a (i,i) Next i Print s End Sub 运行时的输出结果是( )。
以下程序段中语句 Print i*j 执行的次数是。 For i=1 to 3 For j=5 to 1 step -1 Print i*j Next j,i
以下程序段中语句 Print i*j 执行的次数是。 For i=1 to 3 For j=5 to 1 step -1 Print i*j Next j,i
假设有以下程序段: For i=1 to 3 For j=5 to 1 Step -1 Next j Next i Print i,j 则i、j的值分别是
假设有以下程序段: For i=1 to 3 For j=5 to 1 Step -1 Next j Next i Print i,j 则i、j的值分别是
执行下列程序段后,输出结果是 n = 0 For i=1 To 3 For j=5 To 1 Step -1 n = n + 1 Next j, i Debug.Print n; j; i
执行下列程序段后,输出结果是 n = 0 For i=1 To 3 For j=5 To 1 Step -1 n = n + 1 Next j, i Debug.Print n; j; i
下面的程序段执行后共循环了 次 For i = 1 To 2 For j = 5 To 1 Step -1 Print i*j Next j Next i
下面的程序段执行后共循环了 次 For i = 1 To 2 For j = 5 To 1 Step -1 Print i*j Next j Next i
以下程序,执行循环体的次数是。 For i=1 To 3 For j=5 To 1 step -1 print i+j Next j Next i
以下程序,执行循环体的次数是。 For i=1 To 3 For j=5 To 1 step -1 print i+j Next j Next i