- 博客(2)
- 收藏
- 关注
原创 6种排序算法代码
1、冒泡排序 void BubbleSort(int *arr,int n) { int i,j; int tem; for(i=0;i for(j=0;j { if(arr[j+1] { tem=arr[j+1]; arr[j+1]=arr[j]; arr[j]=tem; } } } 2、选择排序 void SelectSort(int arr[],in
2015-08-03 22:13:21
462
转载 查找字符串中每个字符出现的个数
*开辟数组空间来存储字母的出现个数* #include void AppearCount(char *str) { static int count[256]={0}; while(*str) { count[*str]++; str++; } for(int i=0;i { if(count[i]!=0) printf("字母%c出现的次数为%d.\n",i,coun
2015-07-24 15:48:51
702
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人