knapsack.cpp: In function 'int main()':
knapsack.cpp:8:62: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'long int*' [-Wformat=]
8 | std::vector<long> v, w; long s, n, x, y, z; std::scanf("%d %d", &s, &n); long t = 0;
| ~^ ~~
| | |
| int* long int*
| %ld
knapsack.cpp:8:65: warning: format '%d' expects argument of type 'int*', but argument 3 has type 'long int*' [-Wformat=]
8 | std::vector<long> v, w; long s, n, x, y, z; std::scanf("%d %d", &s, &n); long t = 0;
| ~^ ~~
| | |
| int* long int*
| %ld
knapsack.cpp:11:22: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'long int*' [-Wformat=]
11 | std::scanf("%d %d %d", &y, &z, &x);
| ~^ ~~
| | |
| int* long int*
| %ld
knapsack.cpp:11:25: warning: format '%d' expects argument of type 'int*', but argument 3 has type 'long int*' [-Wformat=]
11 | std::scanf("%d %d %d", &y, &z, &x);
| ~^ ~~
| | |
| int* long int*
| %ld
knapsack.cpp:11:28: warning: format '%d' expects argument of type 'int*', but argument 4 has type 'long int*' [-Wformat=]
11 | std::scanf("%d %d %d", &y, &z, &x);
| ~^ ~~
| | |
| int* long int*
| %ld
knapsack.cpp:34:22: warning: comparison of integer expressions of different signedness: 'long int' and 'std::vector<long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
34 | for (long i=1; i <= v.size(); i++) {
| ~~^~~~~~~~~~~
knapsack.cpp:8:59: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
8 | std::vector<long> v, w; long s, n, x, y, z; std::scanf("%d %d", &s, &n); long t = 0;
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~
knapsack.cpp:11:19: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
11 | std::scanf("%d %d %d", &y, &z, &x);
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~