From 27b8394a47bbc9cf74f14777b9d0b4dd36be98c2 Mon Sep 17 00:00:00 2001 From: Oleksandr Hryshchenko Date: Thu, 15 Apr 2021 19:09:26 +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 | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/du6/program.c b/du6/program.c index bdeb64a..fab13df 100644 --- a/du6/program.c +++ b/du6/program.c @@ -53,14 +53,13 @@ int main(){ } printf("Prijati studenti:\n"); - for(int i = 1; i <= finalPosition+1; i++) { + for(int i = 1; i <= freePlaces; i++) { if(isalpha(inputs[i][0])){ printf ("%s", inputs[i]); } - if(i == 5) break; } - if(6 < finalPosition) printf("Neprijati studenti:\n"); - for(int i = 6; i <= finalPosition; i++){ + if(freePlaces < finalPosition) printf("Neprijati studenti:\n"); + for(int i = freePlaces; i <= finalPosition; i++){ if(isalpha(inputs[i][0])){ printf("%s", inputs[i]); }