// Sorting1.cpp : Defines the entry point for the console application. // #include "stdafx.h" int data[25] = {3,1,4,1,5, 9,2,6,5,3, 5,8,9,7,9, 3,2,3,8,4, 6,2,6,4,3}; int _tmain(int argc, _TCHAR* argv[]) { int i, j, temp; for(i=1; i<=24; i++) for(j=1; j<=25-i; j++) if(data[j] < data[j-1]) { temp = data[j]; data[j] = data[j-1]; data[j-1] = temp; } for(i=0; i<=24; i++) printf("%3d\n", data[i]); return 0; }