From fc66796accd883d21a9c33be373948428410d8fe Mon Sep 17 00:00:00 2001 From: Michal Utlak Date: Mon, 22 Apr 2024 17:30:43 +0200 Subject: [PATCH] fix --- cv10/program.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cv10/program.c b/cv10/program.c index 536a3b0..646e6ef 100644 --- a/cv10/program.c +++ b/cv10/program.c @@ -27,6 +27,16 @@ int main() { return 1; } + for (int i = 0; i < pocet_studentov - 1; i++) { + for (int j = i + 1; j < pocet_studentov; j++) { + if (strcmp(pole[i], pole[j]) == 0) { + strcpy(pole[j], pole[pocet_studentov - 1]); + pocet_studentov--; + j--; + } + } + } + for (int i = 0; i < pocet_studentov - 1; i++) { for (int j = i + 1; j < pocet_studentov; j++) {