From 311b471e321865fa8ff98829f8a9b16223912ebc Mon Sep 17 00:00:00 2001 From: Oleksandr Hryshchenko Date: Fri, 16 Apr 2021 11:12:42 +0000 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20'du6/program.c'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- du6/program.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/du6/program.c b/du6/program.c index bde1549..83765ae 100644 --- a/du6/program.c +++ b/du6/program.c @@ -32,8 +32,8 @@ int main() { //The code below removes repeating applicants for(int i = 0; i <= finalPosition; i++){ - for(int j = i+1; j <= finalPosition; j++){ - if(!strcmp(inputs[i], inputs[j])) { + for(int j = 0; j <= finalPosition; j++){ + if(!strcmp(inputs[i], inputs[j]) && i != j) { strcpy(inputs[i], inputs[finalPosition]); memset(inputs[finalPosition--], '\0', 50); }