선택정렬 C언어와 파이썬 비교
main.c
#include
#include
#include "selection_sort.h"
void printArray(int value[], int count);
int main()
{
int values[] = { 80, 75, 10, 60, 15, 49, 12, 25 };
int count = sizeof(values)/sizeof(int);
printArray(values, count);
printf("\n선택 정렬이 시작됩니다 \n");
selection_sort(values, count);
printArray(values, count);
return 0;
}
void printArray(int value[], int count)
{
int i = 0;
for(i = 0; i < count; i++) {
printf("%d ", value[i]);
}
printf("\n");
}
selection_sort.h
#ifndef SELECTION_SORT_H_INCLUDED
#define SELECTION_SORT_H_INCLUDED
void selection_sort(int value[], int count);
#endif // SELECTION_SORT_H_INCLUDED
selection_sort.c
댓글 없음:
댓글 쓰기