Изменить 'du5/program.c'

This commit is contained in:
Oleksandr Hryshchenko 2021-04-06 15:31:39 +00:00
parent 7a45dbdaca
commit 14c9578ef1

View File

@ -62,6 +62,7 @@ int main() {
for(int i = 0; i < 100; i++) for(int i = 0; i < 100; i++)
myEntries[i] = (struct entry*) calloc(1, sizeof(struct entry)); myEntries[i] = (struct entry*) calloc(1, sizeof(struct entry));
char inputs[100][50]; //input char inputs[100][50]; //input
strcpy(inputs[0], "('-_-)")
int counter; //counter int counter; //counter
char symbol; //current symbol char symbol; //current symbol
char* number1 = (char*) calloc(25, sizeof(char)); //temporary points char* number1 = (char*) calloc(25, sizeof(char)); //temporary points
@ -107,7 +108,9 @@ int main() {
if(!checked) if(!checked)
myEntries[position] = createEntry(name, (int)strtol(number1, &ptr, 10)); myEntries[position] = createEntry(name, (int)strtol(number1, &ptr, 10));
} }
if(!strcmp(inputs[0], "('-_-)"){
return 0;
}
bsortDesc(myEntries, position+1); bsortDesc(myEntries, position+1);
printf("Vysledky:\n"); printf("Vysledky:\n");
for(int i = 0; myEntries[i]->name != NULL; i++) { for(int i = 0; myEntries[i]->name != NULL; i++) {