|
도르레 님이 쓰신 글 :
: void __fastcall TForm1::Button1Click(TObject *Sender)
: {
: int temp[9] = { 3, 2, 1, 5, 4, 7, 8, 0, 6 };
: int tempCount = 9;
: int hold=0,loop,i;
:
: for (loop = 0; loop<tempCount; loop++) {
: for (i = 0; i<tempCount-1; i++) {
: if (temp[i] > temp[i+1]) {
: hold = temp[i];
: temp[i] = temp[i+1];
: temp[i+1] = hold;
: printf("%d", temp[i]);
:
: }
: }
: }
:
: }
:
: 마지막에 버블정렬 된 거를 출력하고 printf문을 썼고... 여기서 Button1을 클릭하면 버블 정렬된 숫자를 나열해서 보여주려면 어떻게 해야 되나요?
오오미 빌더인거같은데 printf는 대체뭥미 ....
Tmemo 콤포넌트 같은걸 써서 거기다 보내면되요 printf 는 콘솔 (도스)용 함수임 ㅡ.ㅡ
|