网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
单选题
int i = 1,j = 10; do { if(i>j) { break; } j--; } while (++i <5); System.out.println(“i =” +i+” and j = “+j); What is the result?()
A
i = 6 and j = 5
B
i = 5 and j = 5
C
i = 6 and j = 4
D
i = 5 and j = 6
E
i = 6 and j = 6
参考答案
参考解析
解析:
暂无解析
更多 “单选题int i = 1,j = 10; do { if(ij) { break; } j--; } while (++i 5); System.out.println(“i =” +i+” and j = “+j); What is the result?()A i = 6 and j = 5B i = 5 and j = 5C i = 6 and j = 4D i = 5 and j = 6E i = 6 and j = 6” 相关考题
考题
●试题四阅读下列函数说明和C代码,将应填入(n)处的字句写在答题纸的对应栏内。【说明】函数QuickSort是在一维数组A[n]上进行快速排序的递归算法。【函数】void QuickSort(int A[],int s,int t){int i=s,j=t+1,temp;int x=A[s];do{do i++;while (1) ;do j--;while(A[j]x);if(ij){temp=A[i]; (2) ; (3) ;}}while(ij);A[a]=A[j];A[j]=x;if(si-1) (4) ;if(j+1t) (5) ;}
考题
有以下程序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
考题
( 9 )阅读下列程序段int i=3 , j ;outer:while ( i0 ){J=3;inner:while ( j0 ){if ( j2 ) break outer;System.out.println ( j+"and"+i ) ;j-- ;}i--;}被输出到屏幕的第一行结果是 【 9 】
考题
在执行完此程序段后,i,j值为 int i=1,j=10; do{ if(++i>j--)continue; }while(i<5);A.i=6 and j=5B.i=5 and j=5C.i=6 and j=4D.i=5 and j=6
考题
阅读下列程序段int i=3,j;outer:while(i>0){j=3;inner:while(j>0){if(j<2) break outer;System.out.println(j+"and"+i);j--;}i--;}被输出到屏幕的第一行结果是【 】 。
考题
有以下程序:includeusing namespace std;int main(){ inty=18,i=0,j,a[8]; do{ a[i]=
有以下程序: #include <iostream> using namespace std; int main() { int y=18,i=0,j,a[8]; do{ a[i]=y%2; i++; y=y/2; }while(y>=1); for(j=i-1;i>=0;j--) cout<<a[j]; coutA.1000B.10010C.110D.10100
考题
阅读下列C程序和程序说明,将应填入(n)处的字句写在对应栏内。【说明】下面是一个用C编写的快速排序算法。为了避免最坏情况,取基准记录pivot时,采用从left、right和mid=[(left+right)/2]中取中间值,并交换到right位置的办法。数组a存放待排序的一组记录,数据类型为T,left和right是待排序子区间的最左端点和最右端点。void quicksort (int a[], int left, int right) {int temp;if (left<right) {hat pivot = median3 (a, left, right); //三者取中子程序int i = left, j = right-1;for(;;){while (i <j a[i] < pivot) i++;while (i <j pivot < a[j]) j--;if(i<j){temp = a[i]; a[j] = a[i]; a[i] = temp;i++; j--;}else break;}if (a[i] > pivot){temp = a[i]; a[i] = a[right]; a[right] = temp;}quicksort( (1) ); //递归排序左子区间quieksort(a,i+1 ,right); //递归排序右子区间}}void median3 (int a[], int left, int right){ int mid=(2);int k = left;if(a[mid] < a[k])k = mid;if(a[high] < a[k]) k = high; //选最小记录int temp = a[k]; a[k] = a[left]; a[left] = temp; //最小者交换到 leftif(a[mid] < a[right]){temp=a[mid]; a[mid]=a[right]; a[right]=temp;}}消去第二个递归调用 quicksort (a,i+1,right)。 采用循环的办法:void quicksort (int a[], int left, int right) {int temp; int i,j;(3) {int pivot = median3(a, left, right); //三者取中子程序i = left; j = righi-1;for (;; ){while (i<j a[i] < pivot)i++;while (i<j pivot <a[j]) j--;if(i <j) {temp = a[i]; a[j]; = a[i]; a[i]=temp;i++; j--;}else break;}if(a[i]>pivot){(4);a[i]=pivot;}quicksoft ((5)); //递归排序左子区间left = i+1;}}
考题
阅读下列函数说明和C代码,将应填入(n)处的字句写在对应栏内。【说明】函数QuickSort是在一维数组A[n]上进行快速排序的递归算法。【函数】void QuickSort( int A[ ],int s,int t){ int i=s,j=t+1,temp;int x=A[s];do{do i ++ ;while (1);do j -- ;while(A[j]>x);if(i<j){temp=A[i];(2);(3);}}while(i<j);A[a] =A[j];A[j] =x;if(s<i-1) (4);if(j+1<t) (5);}
考题
inti=1,j=10;do{if(ij){break;}j--;}while(++i5);System.out.println(i=”+i+”andj=+j);Whatistheresult?()
A.i=6andj=5B.i=5andj=5C.i=6andj=4D.i=5andj=6E.i=6andj=6
考题
已知C源程序如下: include include void reverse(char S[]){ int C,i,J; f
已知C源程序如下:include<stdio. h>include<string. h>void reverse(char S[]){int C,i,J;for(i=0,j=strlen(s)-1;i<j;i++,j++){c=s[i];s[i]=s[j];s[j]=c;}}void getHex(int number,char s[]){int I;i=0;while(number>0){if(number%16<10)s[i++]=number%16+'0';elseswitch(number%16){case 10:s[i++]='A';break;case 11:s[i++]='B';break;case 12:s[i++]='C';break;case 13:s[i++]='D';break;case 14:s[i++]='E';break;case 15:s[i++]='F';break;default:printf("Error");break;}number/=16;}s[i]:'\o';reverse(s);}int main(){unsigned int number;int i=0:char s[50];printf("%s","please input number;\n");scanf("%d",&number):getHex(number,s);i=0;while(s[i])printf("%c",s[i++]);return 0;}画出程序中所有函数的控制流程图。
考题
以下程序的输出结果是( )。 include main() {int i=10,j=0; do {j=j+i; i--; }while(i>5
以下程序的输出结果是( )。 include<stdio.h> main() {int i=10,j=0; do {j=j+i; i--; }while(i>5); printf("%d\n",j); }
考题
下面程序的运行结果是( )。 define P(A)printf("%d",A)main() {int j,a[]={1,2,3,4,5,6,7},i=5; for(j=3;j>1;j--) {switch(j) {case 1: case 2:P(a[i++]);break; case 3:P(a[--i]); } } }
考题
以下程序运行后,输出结果为______。 main() {int y=18,i=0 j,a[8]; do { a[i]=y%2; i++; y=y/2; } while(y>=1); for(j=1-1;j>=0;j--) printf("%d",a[j]); printf("\n"); }A.10000B.10010C.110D.10100
考题
以下程序运行后的输出结果是【】。include main(){int i=10,j=0;do{j=j+ i; i--;}while
以下程序运行后的输出结果是【 】。include <iostream.h>main(){int i=10,j=0;do{j=j+ i; i--;}while(i>2);cout<<j;}
考题
以下程序运行后的输出结果是______。 main () { int y=18,i=0,j,a[8]; do { a[i]=y%2;i++; y=y/2; } while(y>=1); for(j=i-1;j>=0;j--)printf("%d",a[j]); printf("\n"); }A.1000B.10010C.110D.10100
考题
控制台应用程序 example.java 如下:public class example{public static void main(String[] args){int i=0, j=9;do{if(i++--j) break;} while(i4);System.out.println("i="+i+" and j="+j);}}
考题
以下程序运行后,输出结果是( )。 main() {int y=18,i=0,j,a[8]; do { a[i]’y%2; i++; y=y/2; } while(y>=1); for(j=i-1;j>=0;j--) printf("%d",a[j]); printf("\n"); }A.1000B.10010C.110D.10100
考题
在执行完此程序段后,i,j值为 int i=1-10; do{ if(++i>j--)continue; } while(i<5);A.i=6 and j=5B.i=5 and j=5C.i=6 and j=4D.i=5 and j=6
考题
下列语句中不是死循环的是( )。A.int i=10;B.for(int i=1;j10;i++) while(1) { { i--; i--; } if(i==1)break;C.int i-0;D.int i=1:
考题
给出下列代码段: int i=3,j; outer:while(i>0) { j=3; inner:while(j>0) { if(j<3) break outer; System.out.println(j+"and"+i); j--; } i--; }下列选项中( )会被输出到屏幕。A.3 and 3B.3 and 2C.3 and 1D. 3 and 0
考题
以下选项中循环结构合法的是( )。A.while (int i<7) { i+ + System.out.println("i is" + i): }B.int j:3; while (j) { System.out.println("j is"+j); }C.int j=O; for (int k=0; j + k!=10; j + +, k+ +) { System.out.println("j is"+j +,"k is"+ k): }D.int i=0: do{ {System.out.println("j is"+ j+ +); if (j==3){continue loop;} }while(j<10);
考题
观察以下程序段:int i=1,j=10;do{if(i++>--j) continue;} while(i
A. i=6 j=5B. i=5 j=5C. i=6 j=4D. i=5 j=6
考题
以下程序的运行结果为:public class test {public static void main(String args[]) {int i=0, j=2;do {i=++i;j--;} while(j>0);System.out.println(i);}}
A. 0B. 1C. 2D.3
考题
int i = 1,j = 10; do{ if (ij) { continue; } j--; } while (++i 6); System.out.println(“i = “ +i+” and j = “+j); What is the result?() A、 i = 6 and j = 5B、 i = 5 and j = 5C、 i = 6 and j = 4D、 i = 5 and j = 6E、 i = 6 and j = 6
考题
int i= 1, j= 10 ; do ( if (i++ --j) continue; ) while (i5); After execution, what are the values for I and j?() A、 i = 6 and j= 5B、 i = 5 and j= 5C、 i = 6 and j= 4D、 i = 5 and j= 6E、 i = 6 and j= 6
考题
int i = 1,j = 10; do { if(ij) { break; } j--; } while (++i 5); System.out.println(“i =” +i+” and j = “+j); What is the result?()A、 i = 6 and j = 5B、 i = 5 and j = 5C、 i = 6 and j = 4D、 i = 5 and j = 6E、 i = 6 and j = 6
考题
单选题int i = 1,j = 10; do{ if (ij) { continue; } j--; } while (++i 6); System.out.println(“i = “ +i+” and j = “+j); What is the result?()A
i = 6 and j = 5B
i = 5 and j = 5C
i = 6 and j = 4D
i = 5 and j = 6E
i = 6 and j = 6
考题
单选题int i = 1,j = 10; do { if(ij) { break; } j--; } while (++i 5); System.out.println(“i =” +i+” and j = “+j); What is the result?()A
i = 6 and j = 5B
i = 5 and j = 5C
i = 6 and j = 4D
i = 5 and j = 6E
i = 6 and j = 6
热门标签
最新试卷