Borderou de evaluare (job #721809)
Utilizator |
|
IP | ascuns |
---|---|---|---|
Problemă | Rucsac fractionar | Compilator | cpp-32 |
Rundă | Arhiva de probleme | Status | evaluat |
Dată | 26 mai 2023 16:18:21 | Scor | 0 |
Raport evaluator
Eroare de compilare:
main.cpp:8:11: error: expected ':' before 'float'
8 | public
| ^
| :
9 | float profit,greutate;
| ~~~~~
main.cpp:10:17: error: expected type-specifier before '(' token
10 | int operator(obiecte obj){
| ^
main.cpp: In function 'int main()':
main.cpp:19:5: error: 'stdcin' was not declared in this scope; did you mean 'stdin'?
19 | stdcin N K;
| ^~~~~~
| stdin
main.cpp:21:5: error: 'stdvectorobiecte' was not declared in this scope
21 | stdvectorobiecte rucsac;
| ^~~~~~~~~~~~~~~~
main.cpp:22:22: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
22 | for(int i = 1; i = N; i++){
| ~~^~~
main.cpp:23:15: error: expected ';' before 'temp'
23 | stdcin temp.greutate temp.profit;
| ^ ~~~~
| ;
main.cpp:24:9: error: 'rucsac' was not declared in this scope
24 | rucsac.push_back(temp);
| ^~~~~~
main.cpp:26:10: error: 'rucsac' was not declared in this scope
26 | sort(rucsac.begin(),rucsac.end());
| ^~~~~~
main.cpp:26:5: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
26 | sort(rucsac.begin(),rucsac.end());
| ^~~~
| std::sort
In file included from /usr/lib/gcc/i686-pc-linux-gnu/12/include/g++-v12/algorithm:61,
from main.cpp:3:
/usr/lib/gcc/i686-pc-linux-gnu/12/include/g++-v12/bits/stl_algo.h:4841:5: note: 'std::sort' declared here
4841 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
| ^~~~
main.cpp:28:26: error: expected ')' before 'K'
28 | while(greutate_curent K && i rucsac.size()){
| ~ ^ ~
| )
main.cpp:28:34: error: expected ';' before 'rucsac'
28 | while(greutate_curent K && i rucsac.size()){
| ^ ~~~~~~
| ;
main.cpp:28:30: warning: statement has no effect [-Wunused-value]
28 | while(greutate_curent K && i rucsac.size()){
| ~~^~~~