- Apr 09 Thu 2009 09:36
-
開發方式
- Apr 09 Thu 2009 08:59
-
Innocence Love
- Apr 09 Thu 2009 00:00
-
rails 第3步 (建造View)
- Apr 08 Wed 2009 22:50
-
rails 第2步 (建立Controller)

step1: 建立Controller ( 使用rails的生成器 generator )
ruby script/generate controller Testing
step2: 執行Controller
http://localhost:3000/greeting
- Apr 08 Wed 2009 22:21
-
日本文化(鞠躬)

鞠躬:
在日本,幾乎一切的問候、致意均伴以鞠躬
鞠躬不僅具有崇拜的功能、問候的功能、致禮的功能,而且反映了人際關係中的等級次序
日本的鞠恭大致分為三種:最敬的鞠躬禮、普通的鞠躬禮和輕微的鞠躬禮
- Apr 08 Wed 2009 17:48
-
數獨
- Apr 07 Tue 2009 22:27
-
HeapSort
- Apr 07 Tue 2009 20:22
-
Love Story
- Apr 07 Tue 2009 19:57
-
InsertionSort

#include<iostream>
#include<time.h>
#include<iomanip>
#include<stdlib.h>
using namespace std;
#define size 10
#define start 0
void Swap(int &a,int &b)
{
int buf;
buf = a;
a = b;
b = buf;
}
void InsertionSort(int *array)
{
for(int i = start+1;i<size;i++)
{
int j = i;
while( j>0 && array[j]<array[j-1] )
{
Swap( array[j] , array[j-1] );
j--;
}
}
}
int main()
{
srand(time(0));
int *array = new int[size];
int time1,time2;
cout<<"Oringinal List: ";
for(int i = start;i<size;i++)
{
array[i] = rand()%20+1;
cout<<setiosflags(ios::right)<<setw(5)<<array[i];
}
cout<<endl<<endl;
time1 = time(0);
InsertionSort(array);
time2 = time(0);
cout<<"After List: ";
for(int j = start;j<size;j++)
{
cout<<setiosflags(ios::right)<<setw(5)<<array[j];
}
cout<<endl<<endl;
cout<<"Time: "<<time2-time1<<" Seconds"<<endl<<endl;
return 0;
}









