From 68c8725ddba93ab753a4a1aae9824597d357c3dc Mon Sep 17 00:00:00 2001 From: Oleksandr Hryshchenko Date: Thu, 1 Apr 2021 14:59:07 +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'du5/program.c'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ^^ --- du5/program.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/du5/program.c b/du5/program.c index f0aeabc..ab45005 100644 --- a/du5/program.c +++ b/du5/program.c @@ -1,5 +1,40 @@ #include +#include +#include + +struct entry{ + char* name; + int votes; +} + +struct entry* createEntry(char* name, int votes){ + struct entry* newEntry = (struct entry*) calloc(1, sizeof(struct entry)); + strcpy(newEntry->name, name); + newEntry->votes = votes; + return newEntry; +} int main(){ + struct entry myEntries[100]; + char inputs[100][50]; + int counter = 0; + char symbol; + char* number1 = (char*) calloc (25, sizeof(char)); + for(int i = 0; fgets(inputs[1], 50, stdin) != NULL; i++){ + counter = 0; + symbol = inputs[i][counter++]; + while(symbol != '\0' && symbol != '\n'){ + while(isspace(symbol)) + symbol = inputs[i][counter++]; + + if(isdigit(symbol)) + number1 += symbol; + else if(isalpha) + } + } + + + + return 0; }