填空题

下面程序的功能是将字符数组a中下标值为偶数的元素从小到大排列,其他元素不变,请填空。 #include<iostream.h> #include <string.h> void main() { char a[]="clanguage",t; inti,j,k; k=strlen(a); for(i:0;i<=k-2;i+=2) for(j=i+2;j<=k; 【9】 ) if( 【10】 ) { t=a[i]; a[i] =a[j]; a[j] =t; } cout<<a; cout<<endl;}

【参考答案】

[9]j+=2
热门 试题