Skip to content

Sort station#8

Open
EStarikov wants to merge 2 commits intomainfrom
sort_station
Open

Sort station#8
EStarikov wants to merge 2 commits intomainfrom
sort_station

Conversation

@EStarikov
Copy link
Owner

No description provided.

@EStarikov EStarikov requested a review from chernishev October 16, 2025 21:13
#include <string.h>
#include "stack.h"

int definition(char a) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

При чём тут definition? Это priority, или как-нибудь так.

}
return 0;
}
int main() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Лучше выделить алгоритм в отдельную функцию

int index = 0;
for (int i = 0; s[i] != '\0'; ++i) {
int t = definition(s[i]);
if (t == 0) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Если Вы хотите кодировать категорию символа числом (что, в целом, довольно хорошее решение), то используйте символьные константы:

#define RPAREN -2
#define LPAREN -1
#define OTHER 0
...

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