标签:des style blog io ar for 数据 div 2014
1 2 3 5 4 6 8 9 10 7
1 2 3 4 5 6 7 8 9 10 1 2 3 5 4 6 10 7 8 9
#include<stdio.h> int main() { int i,j,t,m,a[10],b[10]={1,2,3,4,5,6,7,8,9,10},n=10; for(i=0;i<n;i++) scanf("%d",&a[i]); for(i=0;i<n-1;i++) for(j=0;j<n-i-1;j++) if(a[j]>a[j+1]) { t=a[j];a[j]=a[j+1];a[j+1]=t; m=b[j];b[j]=b[j+1];b[j+1]=m; } for(i=0;i<n;i++) if(i<n-1) printf("%d ",a[i]); else printf("%d",a[i]); printf("\n"); for(i=0;i<n;i++) { if(i<n-1) printf("%d ",b[i]); else printf("%d\n",b[i]); } return 0; }
标签:des style blog io ar for 数据 div 2014
原文地址:http://blog.csdn.net/lvxiaobo1994/article/details/41862193