#include
#define NUM 10
struct data{int value;int seat;} D[NUM],Dtmp;
void main()
{
int i,j,k;
printf("输入%d个整数:",NUM);
for(i=0; i
for(i=0;i
for(i=0; i
{
Dtmp.value = D[j].value; D[j].value=D[j+1].value; D[j+1].value=Dtmp.value;
Dtmp.seat = D[j].seat; D[j].seat=D[j+1].seat; D[j+1].seat=Dtmp.seat;
}
printf("排序后的数据:\n");
for(i=0;i
#include
using namespace std;
int main()
{
int A[10];
int a,b,i,j,k,temp;
cout<<"Input the array:"<
cin>>A[i];
cout<<"输入的数组为:";
for(a=0;a<10;a++) cout<<"A["< cout<
for(k=0;k
temp=A[k];
A[k]=A[k+1];
A[k+1]=temp;
}
}
}
cout<<"排序后的数组为:";
for(b=0;b<10;b++)cout<<"A["< return 0;
}