diff options
author | 2023-05-23 18:40:25 +0600 | |
---|---|---|
committer | 2023-05-23 18:45:10 +0600 | |
commit | e382419d65562d5f79065a30931bfaef094ff984 (patch) | |
tree | b61cdb0f226c231c77b1f907b58965b53dafb575 /src/main.c | |
parent | 09133381cad0a1dec37595867eadf9c6858ce8ee (diff) | |
download | c-obp-example-e382419d65562d5f79065a30931bfaef094ff984.tar.gz c-obp-example-e382419d65562d5f79065a30931bfaef094ff984.zip |
Clean up more code
Signed-off-by: Mubashshir <ahmubashshir@gmail.com>
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -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; } |