Borderou de evaluare (job #3346603)

Utilizator dargrigaDarius Griga dargriga Data 14 martie 2026 15:51:13
Problema Evaluarea unei expresii Status done
Runda Arhiva educationala Compilator cpp-64 | Vezi sursa
Scor 0

Raport evaluator

Eroare de compilare: main.cpp: In function 'int calc()': main.cpp:12:5: error: 'r' was not declared in this scope 12 | r=nr.top; | ^ main.cpp:16:36: error: invalid operands of types '<unresolved overloaded function type>' and 'char' to binary 'operator==' 16 | while(op.top()=='('||op.top==')') | ~~~~~~^~~~~ | | | | | char | <unresolved overloaded function type> main.cpp:28:14: error: request for member 'pop' in 'oper', which is of non-class type 'char' 28 | oper.pop(); | ^~~ main.cpp: In function 'int main()': main.cpp:46:12: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare] 46 | while(i<s.size()) | ~^~~~~~~~~ main.cpp:57:24: error: no matching function for call to 'push(int (&)())' 57 | nr.push(calc); | ~~~~~~~^~~~~~ In file included from /usr/include/c++/12.2.1/stack:61, from /usr/include/c++/12.2.1/x86_64-pc-linux-gnu/bits/stdc++.h:89, from main.cpp:1: /usr/include/c++/12.2.1/bits/stl_stack.h:260:7: note: candidate: 'void std::stack<_Tp, _Sequence>::push(const value_type&) [with _Tp = int; _Sequence = std::deque<int, std::allocator<int> >; value_type = int]' (near match) 260 | push(const value_type& __x) | ^~~~ /usr/include/c++/12.2.1/bits/stl_stack.h:260:7: note: conversion of argument 1 would be ill-formed: main.cpp:57:25: error: invalid conversion from 'int (*)()' to 'std::stack<int>::value_type' {aka 'int'} [-fpermissive] 57 | nr.push(calc); | ^~~~ | | | int (*)() /usr/include/c++/12.2.1/bits/stl_stack.h:265:7: note: candidate: 'void std::stack<_Tp, _Sequence>::push(value_type&&) [with _Tp = int; _Sequence = std::deque<int, std::allocator<int> >; value_type = int]' (near match) 265 | push(value_type&& __x) | ^~~~ /usr/include/c++/12.2.1/bits/stl_stack.h:265:7: note: conversion of argument 1 would be ill-formed: main.cpp:57:25: error: invalid conversion from 'int (*)()' to 'std::stack<int>::value_type' {aka 'int'} [-fpermissive] 57 | nr.push(calc); | ^~~~ | | | int (*)() Non zero exit status: 1

Ceva nu functioneaza?