Initialization

This commit is contained in:
Kozar 2024-04-25 18:49:15 +02:00
parent 549752d5ca
commit 212c9690a2

View File

@ -20,7 +20,11 @@ int main() {
} }
i = 0; i = 0;
while (i < count && scanf("%s", buffer) == 1) { while (i < count && fgets(buffer, sizeof(buffer), stdin)) {
int len = strlen(buffer);
if (buffer[len - 1] == '\n') { // Remove newline character if present
buffer[len - 1] = '\0';
}
int found = 0; int found = 0;
for (j = 0; j < i; j++) { for (j = 0; j < i; j++) {
if (strcmp(applications[j], buffer) == 0) { if (strcmp(applications[j], buffer) == 0) {