文本框中输入一些数字字符,用逗号隔开,怎样用delphi实现从大到小...答:;//如果最后还有一个数,将这个数纳入栈 if now<>'' then begin inc(top);val(now,a[top],code);end;//排序 qsort(1,top);s:='';for i:=1 to top do begin str(a[i],now);s:=s+now+',';end;//除去最后一个','s:=copy(s,1,length(s)-1);edit2.text:=s;end;...
c语言中用冒泡排序法排列下列十个数字从小到大1,3,6,8,2,7,9,0,4...答:include <stdio.h>int main(){ int a[10]={1,3,6,8,2,7,9,0,4,5};int i,j;for(i=0;i<10;i++){ for(j=0;j<9-i;j++){ if(a[j]>a[j+1]){ int t=a[j];a[j]=a[j+1];a[j+1]=t;} } } for(i=0;i<10;i++){ printf("%d ",a[i]);} return 0;...
使用冒泡排序法把下列数字按从大到小进行排列(2,4,6,1,3,8,5,10,9...答:main(){ int i,j,temp;int a[10];for(i=0;i<10;i++)scanf ("%d,",&a[i]);for(j=0;j<=9;j++){ for (i=0;i<10-j;i++)if (a[i]>a[i+1]){ temp=a[i];a[i]=a[i+1];a[i+1]=temp;} } for(i=1;i<11;i++)printf("%5d,",a[i] );printf("\n")...