前田稔(Maeda Minoru)の超初心者のプログラム入門
![]()
![]()
| ファイル名 | 説明 |
|---|---|
| SortTBL.cpp | メソッドで配列をソート |
array<int>^ tbl = gcnew array<int>{ 5, 1, 7, 3 };
array<int>^ tbl = { 5, 1, 7, 3 };
|
void sort(array<int> ^t)
{ int n,wk;
n = t->GetLength(0);
for(int i=0; i<n-1; i++)
for(int j=i+1; j<n; j++)
{
if (t[i] > t[j])
{ wk=t[i]; t[i]=t[j]; t[j]=wk; }
}
}
|
![]()