Skip to content

Conversation

@Gadjib
Copy link
Owner

@Gadjib Gadjib commented Nov 1, 2023

No description provided.

Copy link

@yurii-litvinov yurii-litvinov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нужны ещё проектные файлы

Task 3-1/3-1.c Outdated
#include <stdbool.h>
#include <stdlib.h>

void swapp(int* a, int* b)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Оно "swap" обычно

Task 3-1/3-1.c Outdated
return;
}

int element, location;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Неинициализированные переменные запрещены стайлгайдом, и они объявлены раньше времени. Должны объявляться в месте первого использования, по одной, и сразу с начальным значением

Task 3-1/3-1.c Outdated
if (array[i] <= pivot)
{
swapp(&array[i], &array[index]);
index++;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Лучше ++index

Task 3-1/3-1.c Outdated
}
}

swapp (&array[index], &array[end - 1]);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Пробел перед "(" при вызове функции не ставят

Task 3-1/3-1.c Outdated
Comment on lines 75 to 77



Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Две пустые строки подряд не ставят

Task 3-1/3-1.c Outdated



bool arraysEqual(int array1[], int array2[], int len)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Не сокращайте имена — правильнее length

Task 3-1/3-1.c Outdated
Comment on lines 96 to 100
if (arraysEqual(array, arraySorted, arrayLength))
{
return true;
}
return false;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Так не пишут. Правильно, конечно, return arraysEqual(array, arraySorted, arrayLength);

Comment on lines 105 to 121
int array1[] = {4, 1, 8, 5};
int array1Sorted[] = {1, 4, 5, 8};
int array1Length = 4;

int array2[] = {0};
int array2Sorted[] = {0};
int array2Length = 1;

int array3[] = {34, 2452, 143, 34, 134, 566, 3, 100, 1234, 1234, 34, 565, 544};
int array3Sorted[] = {3, 34, 34, 34, 100, 134, 143, 544, 565, 566, 1234, 1234, 2452};
int array3Length = 13;

if (test(array1, array1Sorted, array1Length) && test(array2, array2Sorted, array2Length) && test(array3, array3Sorted, array3Length))
{
printf("Все тесты пройдены\n");
return 0;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Это всё тесты, им нечего делать в main. Вынесите в отдельную функцию

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants