下列会出错的代码是______。 (1) public void modify( ){ (2) int I,j,k; (3) i=100; (4) while(i>0){ (5) j=i*2; (6) System.out.println("The value of j is"+j); (7) k=k+1; (8) } (9) i--; (10) }A.第4行B.第6行C.第7行D.第8行

下列会出错的代码是______。 (1) public void modify( ){ (2) int I,j,k; (3) i=100; (4) while(i>0){ (5) j=i*2; (6) System.out.println("The value of j is"+j); (7) k=k+1; (8) } (9) i--; (10) }

A.第4行

B.第6行

C.第7行

D.第8行


相关考题:

有以下程序inclUdevoidfun(int*s,intn1,intn2){inti,j,t;i=n1;j=n2;while(i 有以下程序 #inclUde <stdio.h> void fun(int *s,int n1,int n2) { int i,j,t; i=n1; j=n2; while(i<j) {t=s[i];s[i]=s[j];s[j]=t;i++;j--;} } main() { int a[10]={1,2,3,4,5,6,7,8,9,0},k; fun(a,0,3); fun(a,4A.0987654321B.4321098765C.5678901234D.0987651234

给出下列的代码,哪行在编译时可能会有错误? ① public void modify() { ② int i,j,k; ③ i=100; ④ while(i>0) { ⑤ j=i*2; ⑥ System.out.println(" The value of j is"+ j); ⑦ k=k+1; ⑧ } ⑨}A.line 4B.line 6C.line 7D.line 8

有下列程序: include void fun(int * s,int n1,int n2) { int i,j, 有下列程序: #include <stdio.h> void fun(int * s,int n1,int n2) { int i,j,t; i=n1;j=n2; while(i<j){t=s[i];s[i]=s[j];s[j]=t;i++;j--;} } main() { int a[10]={1,2,3,4,5,6,7,8,9,0},k; fun(a,0,3); fun(a,4,9);fun(a,0,9); for(k=0;k<10;k++)printf("%d",a[k]);printf("\n"); } 程序的运行结果是( )。A.987654321B.4321098765C.5678901234D.987651234

有下列程序: #includestdi0.h voidfun(int*S,intn1,intn2) { inti,j,t; i=n1;j=n2 while(ij){t=s[i];s[i]=s[j];s[j]=t;i++;j --;} } voidmain( ) { inta[10]={1,2,3,4,5,6,7,8,9,0),k; fun(a,0,3);fun(a,4,9);fun(a,0,9); for(k=0;k10;k++)printf(”%d”,a[k]);printf ("\n"); } 程序的运行结果是( )。A.0987654321B.4321098765C.5678901234D.0987651234

阅读以下说明及C++程序代码,将应填入(n)处的语句写在对应栏内。【说明】本程序的功能是实现任意两个大整数的乘法运算,例如:输入整数1:8934793850094505800243958034985058输入整数2:234584950989689084095803583095820923二者之积:209596817742739508050978890737675662366433464256830959194834854876 8534【C++代码】include<iostream.h>const int MAXINPUTBIT=100;const int MAXRESULTBIT=500;class LargeNumber{int i,j;int temp;int one[MAXINPUTBIT+1];int onebit; //one的位数int two[MAXINPUTBIT+1];int twobit; //two的位数int result[MAXRESULTBIT+1];public:LargeNumber();~LargeNumber();int inputone(); //出错返叫0,否则返回1int inputtwo(); //同上void multiplication(); //乘void clearresult(); //清零void showresult(); //显示};LargeNumber∷LargeNumber(){for(i=0;i<=MAXINPUTBIT;i++){one[i]=0;two[i]=0;}nebit=0;twobit=0;inputone();inputtwo();}LargeNumber∷~LargeNumber(){}int LargeNumber∷inputone(){char Number[MAXINPUTBIT+1];cout<<"Please enter one:";cin>>Number;i=0;j=MAXINPUTBIT;while(Number[i]!='\0')i++;nebit=i;for(i--;i>=0;i--,j--){if(int(Number[i])>=48int(Number[i])<=57)(1); //由字符转换为数字elsereturn 0;}return 1;}int LargeNumber∷inputtwo(){char Number[MAXINPUTBIT+1];cout<<"Please enter two:";cin>>Number;i=0;j=MAXINPUTBIT;while(Number[i]!='\0')i++;twobit=i;for(i--;i>=0;i--,j--){if(int(Number[i])>=48int(Number[i])<=57)two[j]=int(Number[i]-48); //由字符转换为数字elsereturn 0;}return 1;}void LargeNumber∷multiplication() //乘法{clearresult();int m;for(i=MAXINPUTBIT;i>=0;i--){temp=two[i];for(j=(2),m=MAXINPUTBIT;m>=0;m--,j--){result[j]+=temp*one[m];if(result[j]>9){result[j-1]+=result[j]/10;(3);}}&n

有以下程序includevoidfun(int*s,intn1,intn2){inti,j,t; i=n1j=n2; while(i 有以下程序 #include <stdio.h> void fun(int *s,int n1,int n2) { int i,j,t; i=n1 j=n2; while(i<j) {t=s[i];s[i]=s[j];s[j]=t;i++;j--;} } main() { int a[10]={1,2,3,4,5,6,7,8,9,0},k; fun(a,0,3); fun(a,4,9); fun(a,0,9); for(k=0;k<10;k++)printf("%d",a[k]); printf("\n"); } 程序的运行结果是A.987654321B.4321098765C.5678901234D.987651234

下列代码______行错误。 ( )(1)public void modify( ){(2)intI,j,k,(3)I=100;(4)while(I>0){(5)j=I*2;(6)System.out.println("The value of j is"+j);(7)k=k+1;(8)I--;(9)}(10)}A.-4B.-6C.-7D.-8

给出下列代码,哪行在编译时可能会有错误? ① public void modify(){ ② int i, j, k; ③ i = 100; ④ while (i > 0 ){ ⑤ j = i * 2; ⑥ System.out.println (" The value of j is " + j ); ⑦ k = k + 1; ⑧ } ⑨ }A.4B.6C.7D.8

分析下面语句段执行的时间复杂度。 (1)for (int i=0; i<n; ++i) { ++p; } (2) for (int i<0; i<n; ++i) { for (int j =0; j<m; ++j) { ++p; } } (3) i = 1; while(i <= n) { i *= 3; } (4) int i = 1; int k = 0; do { k = k+10*i; ++i; } while(i!=n);