网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
执行下面程序CLEARFOR I=10 TO 1 STEP-2IF I%3#0I=I-1 ENDIFI=I-2??IENDFOR则I的值是()。
- A、7 2
- B、7 4
- C、6 1
- D、8 4
参考答案
更多 “执行下面程序CLEARFOR I=10 TO 1 STEP-2IF I%3#0I=I-1 ENDIFI=I-2??IENDFOR则I的值是()。A、7 2B、7 4C、6 1D、8 4” 相关考题
考题
有 以下程序void f(int b[]){ int i;for(i=2;i6;i++) b[i]*=2;}main( ){ int a[10]={1,2,3,4,5,6,7,8,9,10},i;f(a);for(i=0;i10;i++) printf("%d",a[i]);}程序运行后的输出结果是A)1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ,B)1 , 2 , 6 , 8 , 10 , 12 , 7 , 8 , 9,10C)1 , 2 , 3 , 4 , 10 , 12 , 14 , 16 , 9 , 10 ,D)1 , 2 , 6 , 8 , 10 , 12 , 14 , 16 , 9 , 10 ,
考题
下面程序中有错误的行是(每行程序前面的数字表示行号) 1 main() 2 { 3 int a[3]={1}; 4 int i; 5 scanf("%d",a); 6 for(i-1;i<3;i++)a[0]=a[0]+a[i]; 7 printf("a[0]=%d\n ,"a[0]); 8 }A.3B.6C.7D.5
考题
请阅读程序:Option Base 1Pfivate Sub Form_Click()Dim Arr(4,4)As IntegerFor i=1 To 4For j=1 To 4Arr(i,j)=(i-1)*2+jNext jNext iFor i=3 To 4For j=3 To 4Print Arr(j,i);Next jPrintNext iEnd Sub程序运行后,单击窗体,则输出结果是( )。A.5 7 6 8B.6 8 7 9C.7 9 8 10D.8 10 8 11
考题
有以下程序:include main( ){int num[4][4]={{1,2,3,4},{5,6,7,8},{9,10,11,12},{13;1
有以下程序: #include <stdio.h> main( ) { int num[4][4]={{1,2,3,4},{5,6,7,8},{9,10,11,12},{13;14,15,16}},i,j; for(i =0;i<4;i ++ ) { for(j=0;j<=i;j++)printf("%4c","); for(j=______;j<4;j ++ )printf( "%4d" ,hum[i] [j] ); printf(" \n" ); } } 若要按以下形式输出数组右上半三角; 1 2 3 4 6 7 8 11 12 16则在程序下划线处应填入的是( )。A.i-1B.iC.i+1D.4-i
考题
运行下面的程序I = 0DO WHILE I10IF INT(I/2)=I/2?"偶数"ELSE ?"奇数"ENDIFI=I+1ENDDO问语句?"奇数"被执行的次数是A.5B.6C.10D.11
考题
include void sort(inta[],int n) {int i,j,t;for(i=0;i
include<stdio.h>void sort(inta[],int n){int i,j,t;for(i=0;i<n-1;i++)for(j=i+1;<n;j++)if(a[i]<a[j]){t=a[i];a[i]=a[j];a[j]=t;}}main(){int a[10]={1,2,3,4,5,6,7,8,9,10},i;sort(a[1],7);for(i=0;i<10;i++)printf("%d,",a[i]);}程序运行后的输出结果是( )。A.1,2,3,4,5,6,7,8,9,10,B.10,9,8,7,6,5,4,3,2,1,C.1,8,7,6,5,4,3,2,9,10,D.1,2,10,9,8,7,6,5,4,3,
考题
请阅读程序: Sub subP(b( )As Integer) For i=1 To4 b(i)=2*i Next i End Sub Private Sub Commandl Click( ) Dim a(1 To 4)As Integer a(1)=5:a(2)=6:a(3)=7:a(4)=8 subP a( ) For i=1 To 4 Print a(i) Next i End Sub 运行上面的程序,单击命令按钮,则输出结果是( )。A.2 4 6 8B.5 6 7 8C.10 12 14 16D.出错
考题
下列程序段执行时在屏幕上显示的结果是( )。 DIME a(6) a(1)=1 a(2)=1 FOR i=3 TO 6 a(i)=a(i-l)+a(i-2) NEXT ?a(6)A.5B.6C.7D.8
考题
下面程序运行后的输出结果是( )。 include main() {int a[]={1,2,3,4,5,6},*k[3],i=1; w
下面程序运行后的输出结果是( )。include<stdio.h>main(){int a[]={1,2,3,4,5,6},*k[3],i=1;while(i<4){ k[i-1]=a[2*i-1];printf("%d",*k[i-1]);i++;}}
考题
在窗体上画一个名称为Commandl的命令按钮,然后编写如下程序: Private Sub Command1_Click() Dim i As Integer,j As Integer Dim a(10, 10)As Integer For i=1 To 3 For i=1 To 3 a(i,j)=(i-1) *3+j Print a(i,j); Next i Print Next i End Sub 程序运行后,单击命令按钮,窗体上显示的是A.1 2 3 246 3 69B.2 3 4 3 4 5 4 5 6C.1 4 7 2 5 8 3 6 9D.1 2 3 4 5 6 7 8 9
考题
有下列程序: #includestdi0.h voidfun(inta,intb) {intt; t=a;a=b;b=t; voidmain( ) {intc[1O]={1,2,3,4,5,6,7,8,9,0},i; for(i=0;i10;i+=2)fun(c[i],c[i+1]); for(i=0;i10;i++)printf(”%d,”,c[i]); printf("\n"); } 程序的运行结果是( )。A.1,2,3,4,5,6,7,8,9,0B.2,1,4,3,6,5,8,7,0,9C.0,9,8,7,6,5,4,3,2,1D.0,1,2,3,4,5,6,7,8,9
考题
阅读如下程序: Option Base 1 Private Sub Form Click() Dim Arr(4,4)As Integer For i=1 To 4 For j=1 To 4 Arr(i,j)=(i-1)*2+j Next j Next i For i=3 To 4 For j=3 To 4 Print Arr(j,i); Next j Print Next i End Sub 程序运行后,单击窗体,输出的结果为A.5 7 6 8B.6 8 7 9C.7 9 8 10D.8 10 8 11
考题
有以下程序 vold soru(int a[], int n) { int i,i,t; for(i=0;i<n-1;i++) for(j=i+1;j<n;j++) if(a[i]<a[j]) { t=a[i]; a[i]=a[i]; a[j]=t; } } main() { int aa[10]={1,2,3,4,5,6,7,8,9,10),i; sore(aa+2, 5); for(i=0;i<10;i++) printf("%d,",aa[i]); printf("\n"); } 程序运行后的输出结果是A.1,2,3,4,5,6,7,8,9,10,B.1,2,7,6,3,4,5,8,9,10,C.1,2,7,6,5,4,3,8,9,10,D.1,2,9,8,7,6,5,4,3,10,
考题
有以下程序void sort(int a[],int n){ int i,j,t; for(i=0;in-1;i+=2) for(j=i+2;jn;j+=2) if(a[i]a[j]) { t=a[i]; a[i]=a[j]; a[j]=t; }}main(){ int aa[10]={1,2,3,4,5,6,7,8,9,10},i; sort(aa,10); for(i=0;i10;i++) printf("%d,",aa[i]); printf("\n");}执行后的输出结果是A.1,2,3,4,5,6,7,8,9,10, B.10,9,8,7,6,5,4,3,2,1, C.9,2,7,4,5,6,3,8,1,10 D.1,10,3,8,5,6,7,4,9,2,
考题
请阅读程序. 0ption Base 1 Private Sub Fo,m Click( ) Dim Arr(4,4)As Integer For i=1 To 4 For j=1 To 4 Arr(i,j)=(i=1)*2+j Next j Next i For i=3 To 4 For j=3 To 4 Print Arr(j,i); Next j Print Next i End Sub 程序运行后,单。旨窗体,则输出结果是( )。A.5 7 6 8B.6 8 7 9C.7 9 8 10D.8 10 8 11
考题
有以下程序: void sort(int a[], int n) {int i,j,t; for(i=0;i<n-1;i++) for(j=i+1;j<n;j++) if(a[i]<a[j]) { t=a[i]; a[i]=a[j]; a[j]=t; } } main() { int aa[10]={1,2,3,4,5,6,7,8,9,10},i; sort(aa+2,5); for(i=0;i<10;i++)printf("%d,",aa[i]); printf("\n"); } 程序运行后的输出结果是( )。A.1,2,3,4,5,6,7,8,9,10,B.1,2,7,6,3,4,5,8,9,10,C.1,2,7,6,5,4,3,8,9,10,D.1,2,9,8,7,6,5,4,3,10,
考题
执行下面的程序段,x的值为 Private Sub Command1_Click( ) For i=1 To 5 a=a+i Next i x=Val(i) MsgBox x End SubA.5B.6C.7D.8
考题
有以下程序: void sott(int a[], int n) { int i, j, t; for(i=0; i<n-1; i++) for(j=i+1; j<n; j++) if(a[i]<a[j]){t=a[i];a[i]=a[j];a[j]=t;) } main() {int aa[10]={1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, I; sort(aa+2, 5); for (i=0; i<10; i++)printf("% d", aa[i]); printf("\n"); } 程序运行后的输出结果是______。A.1, 2, 3, 4, 5, 6, 7, 8, 9, 10,B.1, 2, 7, 6, 3, 4, 5, 8, 9, 10,C.1, 2, 7, 6, 5, 4, 3, 8, 9, 10,D.1, 2, 9, 8, 7, 6, 5, 4, 3, 10,
考题
( 18 )下列程序段执行时在屏幕上显示的结果 是D IME a(6)a (1)=1a (2)=1F OR i=3 TO 6a (i)=a(i-1)+a(i-2)N EXT?a(6)A)5B)6C)7D)8
考题
有程序:INTEGERM(3,3)DATAM/1,2,3,4,5,6,7,8,9/DO10I=1.3DO10J=1,3K=M(I,J)M(I,J)=M(J,I)M(J,I)=K10CONTINUEWRITE(*,100)((M(I,J),J=1,3),I=1,3)100FORMAT(1x,3I2)END此程序执行后的结果为:()A、1;4;7;2;5;8;3;6;9B、1;2;3;4;5;6;7;8;9C、9;6;3;8;5;2;7;4;1D、7;8;9;4;5;6;1;2;3
考题
单选题若有以下程序#include void fun(int a[],int n){ int t,i,j; for(i=1;i for(j=i+2;j if(a[i]a[j]) { t=a[i]; a[i]=a[j]; a[j]=t; }}main(){ int c[10]={10,9,8,7,6,5,4,3,2,1},i; fun(c,10); for(i=0;i printf("");}则程序的输出结果是( )。A
2,9,4,7,6,5,8,3,10,1,B
10,9,8,7,6,5,4,3,2,1,C
10,1,8,3,6,5,4,7,2,9,D
1,10,3,8,5,6,7,4,9,2,
考题
单选题执行下面程序CLEARFOR I=10 TO 1 STEP-2IF I%3#0I=I-1 ENDIFI=I-2??IENDFOR则I的值是()。A
7 2B
7 4C
6 1D
8 4
热门标签
最新试卷