单项选择题
下列给定程序中,函数ptoc的功能是:利用插入排序法对字符串中的字符按从小到大的顺序进行排序。插入法的基本方法...
未知题型下列给定程序中,函数ptoc的功能是:利用插入排序法对字符串中的字符按从小到大的顺序进行排序。插入法的基本方法是:先对字符串中的头两个元素进行排序,然后把第3个字符插入前两个字符中,插入后前3个字符依然有序;再把第4个字符插入前三个字符中,待排序的字符串已 在主函数中赋予。 请修改程序中的错误,使它能得出正确的结果。 注意:不要改动main函数,不得增行或删行,也不得更改程序的结构。 试题程序: include<strin9.h> include<stdi0.h> define M 80 void proc(char*arr) { int i,j,n;char ch; n=strlen(arr): for(i=1;i<n;i++) //****found**** { c=arr[i]; j=i-1; while((j>=o)&&(ch<arr[j])) { arr[j+1]=arr[j]; j--; } arr[j+1]=ch; } } void main { char a[M]='QWERTYUIOPASDFGHJKLMNBVCXZ'; printf('The original string:%s\n',a); proc(a); printf('The string after sortin9: %s\n\n',a); }
What is the only by-product when we burn hydrogen for e...
单项选择题What is the only by-product when we burn hydrogen for energy? A、oxygen B、water C、electricity D、gasoline
Before the formal interview, the personnel staff should...
判断题Before the formal interview, the personnel staff should inform the applicant the time and place of the interview. 正确 错误