该读者墙是基于小松的读者墙3.4版本的一个修改版。主要是使其支持4.1了。
因为读者墙是在首页的,所以就改进了使读者墙的链接不出站。要出站加友链吧··


reader_wall.zip
void bubble_sort(int a[], int n)
{
int i = n-1; bool change = true;
for (; i>=1&&change; --i)
{
change = false;
for (int j = 0; j<i; ++j)
{
if (a[j]>a[j+1])
{
int nTemp = a[j+1];
a[j+1] = a[j];
a[j] = nTemp;
change = true;
}
}
}
}
#include <iostream>
#define LEN 9
using namespace std;
int main(){
int nArray[LEN];
for(int i=0;i<LEN;i++)nArray[i]=LEN-i;
cout<<"原始数据为:"<<endl;
for(int i=0;i<LEN;i++)cout<<nArray[i]<<" ";
cout<<endl;
//开始冒泡
{
int temp;
for(int i=LEN-1;i>0;i--)
for(int j=0;j<i;j++){
if(nArray[j]>nArray[j+1]){
temp=nArray[j];
nArray[j]=nArray[j+1];
nArray[j+1]=temp;
}
}
}
//结束冒泡
cout<<"排序结果:"<<endl;
for(int i=0;i<LEN;i++)cout<<nArray[i]<<" ";
return 0;
}
&l...
插入排序:
packageorg.rut.util.algorithm.support;
importorg.rut.util.algorithm.SortUtil;
publicclassInsertSortimplementsSortUtil.Sort{
publicvoidsort(int[]data) {
inttemp;
for(inti=1;ifor(intj=i;(j>0)&&(data[j]SortUtil.swap(data,j,j-1);
}
}
}
}
冒泡排序:
packageorg.rut.util.algorithm.support;
importorg.rut.util.algorithm.SortUtil;
publicclassBubbleSortimplementsSortUtil.Sort{
publicvoidsort(int[]data) {
inttemp;
for(inti=0;ifor(intj=data.length-1;j>i;j--){
&nb...