- 博客(3)
- 收藏
- 关注
原创 冒泡排序的另外一种做法
#include<stdio.h> int main() { printf(“请输入需要排序的5个数:”); int n,j,k; int a[5]; for(n=0;n<5;n++); scanf("%d",&a[n]);//a[0]-a[4]有值// for(n=0;n<4,n++;);//做了四次循环,实现了四趟比较。// for(k=0;k<4-n;k...
2019-05-30 09:51:15 217
原创 冒泡排序
#include<stdio.h> #define MXAL 10 typedef int KeyType; typedef char InfoType; typedef struct RecType {KeyType key; InfoType data; }RecType; void BubbleSort(RecType R[],int n) //冒泡排序// { int i,j...
2019-05-29 20:21:18 131
原创 冒泡排序
#include<stdio.h> #include BubbleSort(RecType R[],int n) //冒泡排序 { int i,j; bool exchange; for(i=0;i<n-1;i++) { exchange=false; for(j=n-1,j>i;j–) if(R[j].key<R[j-1],key) {swap(R[j],R[j...
2019-05-29 18:07:37 224
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人