pz12_gavrilov

This is a task for our favourite professor
git clone git://git.stellar-nexus.ru/pz12_gavrilov
Log | Files | Refs

commit a237bf2f62d1806163676315c60c8867bbcd1f4d
parent d55636a2084ea8c28a6b58d310e86c8a36a5d710
Author: Plat <plat@stellar-nexus.ru>
Date:   Tue, 25 Nov 2025 15:11:01 +0000

argv0 is now equal to argv[0]

Diffstat:
Mknapsack.h | 1-
Mknapsack_single.c | 4++--
Msort.h | 1-
Msort_single.c | 4++--
4 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/knapsack.h b/knapsack.h @@ -1,4 +1,3 @@ -#define KNAPSACK_NAME "knapsack" int knapsack_bell(unsigned int k, unsigned int w, int m[k], int c[k], int out[k]); int knapsack_greed(unsigned int k, unsigned int w, int m[k], int c[k], int out[k]); int knapsack_full(unsigned int k, unsigned int w, int m[k], int c[k], int out[k]); diff --git a/knapsack_single.c b/knapsack_single.c @@ -29,9 +29,9 @@ input(long long minval, long long maxval) } int -main(void) +main(int argc, char *argv[]) { - argv0 = KNAPSACK_NAME; + argv0 = argv[0]; unsigned int k = input(0, UINT_MAX), w = input(0, UINT_MAX); int *m = emalloc(sizeof(*m) * k), diff --git a/sort.h b/sort.h @@ -1,4 +1,3 @@ -#define SORT_NAME "sort" void bubble_sort(unsigned int n, int a[n]); void choice_sort(unsigned int n, int a[n]); void insert_sort(unsigned int n, int a[n]); diff --git a/sort_single.c b/sort_single.c @@ -31,9 +31,9 @@ input(long long minval, long long maxval) } int -main(void) +main(int argc, char *argv[]) { - argv0 = SORT_NAME; + argv0 = argv[0]; unsigned int n = input(0, UINT_MAX); int *arr = emalloc(sizeof(*arr) * n);