Skip to content

Comments

15. Переписывание контрольных № 1 (143)#4

Open
imaxde wants to merge 3 commits intomainfrom
rewrite
Open

15. Переписывание контрольных № 1 (143)#4
imaxde wants to merge 3 commits intomainfrom
rewrite

Conversation

@imaxde
Copy link
Owner

@imaxde imaxde commented Dec 11, 2025

No description provided.

@imaxde imaxde requested a review from WoWaster December 11, 2025 15:04
while (number != 0) {
scanf("%d", &number);
count++;
array = realloc(array, count * sizeof(int));
Copy link
Collaborator

Choose a reason for hiding this comment

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

А почистить память?

Comment on lines +90 to +91
mergeSort(array, 0, count - 1);
array = removeDuplicates(array, &count);
Copy link
Collaborator

Choose a reason for hiding this comment

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

А от Вас просили другого?

int main(void)
{
int* array = malloc(1 * sizeof(int));
int number = 999;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Довольно странный инициализатор, но ладно

Comment on lines +6 to +8
if (n <= 0) {
return 0;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

А почему бы не использовать беззнаковый тип?

Comment on lines +20 to +26
for (int d = 1; d <= 9; d++) {
if (cnt[d] > 0) {
result = d;
cnt[d]--;
break;
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ну, нет, всё-таки нули стоило откинуть

@@ -0,0 +1,49 @@
#include <stdlib.h>

typedef struct listItem {
Copy link
Collaborator

Choose a reason for hiding this comment

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

По стайлгайду

Suggested change
typedef struct listItem {
typedef struct ListItem {

struct listItem* before;
int value;
int index;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

И по-моему без окончания строки оно не скомпилируется

Comment on lines +32 to +33
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Здесь скобочек многовато

Copy link
Collaborator

Choose a reason for hiding this comment

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

Тестов нет

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.

2 participants