Skip to content

Comments

add kr#12

Draft
Gosha924 wants to merge 1 commit intomasterfrom
first_kr
Draft

add kr#12
Gosha924 wants to merge 1 commit intomasterfrom
first_kr

Conversation

@Gosha924
Copy link
Owner

No description provided.

@Gosha924 Gosha924 requested a review from chernishev October 17, 2025 14:19
Copy link
Collaborator

@p-senichenkov p-senichenkov left a comment

Choose a reason for hiding this comment

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

Сумма цифр: 10/10
Сортировка: 7/10
Палиндром: 8/10

numbers[a] = numbers[b];
numbers[b] = buff;
printArray(numbers, len);
printf("Input y if array sort if not input enter\n");
Copy link
Collaborator

Choose a reason for hiding this comment

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

В таком случае проще уже отсортировать вручную. Нужно реализовать проверку, что массив отсортирован.

#include <stdio.h>
#include <string.h>

int toTwo(int qwerty)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Надо давать переменным осмысленные имена.

{
int num[100];
int i = 0;
int n = qwerty;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Зачем копировать аргумент, если он и так передаётся по значению?

}
int len = sizeof(num) / sizeof(num[0]);
int res = pal(num, len);
if (res == 1) {
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
if (res == 1) {
if (res) {

printf("\n");
}

void appendStr(char* str, char c)
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