Borderou de evaluare (job #631612)
Utilizator |
|
IP | ascuns |
---|---|---|---|
Problemă | Numere10 (clasa a 5-a) | Compilator | cpp-32 |
Rundă | Arhiva de probleme | Status | evaluat |
Dată | 10 feb. 2022 08:13:23 | Scor | 0 |
Raport evaluator
Eroare de compilare:
main.cpp:4:1: error: '::main' must return 'int'
4 | void main()
| ^~~~
main.cpp: In function 'int main()':
main.cpp:6:1: error: 'ifstream' was not declared in this scope; did you mean 'std::ifstream'?
6 | ifstream f("numere14.in");
| ^~~~~~~~
| std::ifstream
In file included from /usr/lib/gcc/i686-pc-linux-gnu/11.2.0/include/g++-v11/ios:38,
from /usr/lib/gcc/i686-pc-linux-gnu/11.2.0/include/g++-v11/istream:38,
from /usr/lib/gcc/i686-pc-linux-gnu/11.2.0/include/g++-v11/fstream:38,
from main.cpp:1:
/usr/lib/gcc/i686-pc-linux-gnu/11.2.0/include/g++-v11/iosfwd:162:41: note: 'std::ifstream' declared here
162 | typedef basic_ifstream<char> ifstream;
| ^~~~~~~~
main.cpp:12:1: error: 'f' was not declared in this scope
12 | f>>n>>k>>p;
| ^
main.cpp:13:1: error: 'cout' was not declared in this scope
13 | cout<<n<<" "<<k<<" "<<p;
| ^~~~
main.cpp:40:8: warning: comparison of integer expressions of different signedness: 'long unsigned int' and 'int' [-Wsign-compare]
40 | while(p>=nr*(nr+1)/2)nr++;
| ~^~~~~~~~~~~~~
main.cpp:44:5: warning: comparison of integer expressions of different signedness: 'long unsigned int' and 'int' [-Wsign-compare]
44 | if(p>nr*(nr+1)/2){p=p-nr*(nr+1)/2;nr++;}
| ~^~~~~~~~~~~~
main.cpp:46:8: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
46 | cout<<endl<<"b)"<<p<<"\nc)"<<nr;
| ^~~~
| std::endl
In file included from /usr/lib/gcc/i686-pc-linux-gnu/11.2.0/include/g++-v11/istream:39,
from /usr/lib/gcc/i686-pc-linux-gnu/11.2.0/include/g++-v11/fstream:38,
from main.cpp:1:
/usr/lib/gcc/i686-pc-linux-gnu/11.2.0/include/g++-v11/ostream:681:5: note: 'std::endl' declared here
681 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~