From e382419d65562d5f79065a30931bfaef094ff984 Mon Sep 17 00:00:00 2001 From: Mubashshir Date: Tue, 23 May 2023 18:40:25 +0600 Subject: Clean up more code Signed-off-by: Mubashshir --- src/main.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index afa1eeb..d8bc1ac 100644 --- a/src/main.c +++ b/src/main.c @@ -12,12 +12,12 @@ int main() { unsigned num = 0, i = 0; char line[255] = ""; - TEAM *teams; + team *teams; getline(line, 255); sscanf(line, "%u", &num); strncpy(line, "", 255); - teams = (TEAM *)malloc(sizeof(TEAM) * num); + teams = (team *)malloc(sizeof(team) * num); if (teams == NULL) { printf("Failed to reserve memory"); @@ -52,6 +52,9 @@ int main() } } - fun(team, printf, fun(team, find_champion, NULL, teams, num)); + team champion = ask(team, find_champion, NULL, teams, num); + ask(team, printf, champion); + + while(num --) del(team, teams[num]); return 0; } -- cgit v1.2.3