Borderou de evaluare (job #635507)
Utilizator |
|
IP | ascuns |
---|---|---|---|
Problemă | Carte (clasa a 6-a) | Compilator | cpp-32 |
Rundă | Arhiva de probleme | Status | evaluat |
Dată | 25 feb. 2022 14:23:11 | Scor | 0 |
Raport evaluator
Eroare de compilare:
main.cpp: In function 'int main()':
main.cpp:9:9: error: conflicting declaration 'int i'
9 | int i, j, n, v[10001], zi, maxi, zimaxi, contor;
| ^
main.cpp:7:14: note: previous declaration as 'std::ifstream i'
7 | ifstream i("carte.in");
| ^
main.cpp:12:14: error: no match for 'operator=' (operand types are 'std::ifstream' {aka 'std::basic_ifstream<char>'} and 'int')
12 | for (i = 1; j <= n; i++)
| ^
In file included from main.cpp:2:
/usr/lib/gcc/i686-pc-linux-gnu/11.2.0/include/g++-v11/fstream:614:7: note: candidate: 'std::basic_ifstream<_CharT, _Traits>& std::basic_ifstream<_CharT, _Traits>::operator=(std::basic_ifstream<_CharT, _Traits>&&) [with _CharT = char; _Traits = std::char_traits<char>]'
614 | operator=(basic_ifstream&& __rhs)
| ^~~~~~~~
/usr/lib/gcc/i686-pc-linux-gnu/11.2.0/include/g++-v11/fstream:614:34: note: no known conversion for argument 1 from 'int' to 'std::basic_ifstream<char>&&'
614 | operator=(basic_ifstream&& __rhs)
| ~~~~~~~~~~~~~~~~~^~~~~
main.cpp:12:26: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
12 | for (i = 1; j <= n; i++)
| ~^~
main.cpp:13:15: error: no match for 'operator[]' (operand types are 'int [10001]' and 'std::ifstream' {aka 'std::basic_ifstream<char>'})
13 | i >> v[i];
| ^
main.cpp:13:15: note: candidate: 'operator[](int*, int)' (built-in)
main.cpp:13:15: note: no known conversion for argument 2 from 'std::ifstream' {aka 'std::basic_ifstream<char>'} to 'int'
main.cpp:19:18: error: no match for 'operator=' (operand types are 'std::ifstream' {aka 'std::basic_ifstream<char>'} and 'int')
19 | for (i = 1, j <= n, i++)
| ^
In file included from main.cpp:2:
/usr/lib/gcc/i686-pc-linux-gnu/11.2.0/include/g++-v11/fstream:614:7: note: candidate: 'std::basic_ifstream<_CharT, _Traits>& std::basic_ifstream<_CharT, _Traits>::operator=(std::basic_ifstream<_CharT, _Traits>&&) [with _CharT = char; _Traits = std::char_traits<char>]'
614 | operator=(basic_ifstream&& __rhs)
| ^~~~~~~~
/usr/lib/gcc/i686-pc-linux-gnu/11.2.0/include/g++-v11/fstream:614:34: note: no known conversion for argument 1 from 'int' to 'std::basic_ifstream<char>&&'
614 | operator=(basic_ifstream&& __rhs)
| ~~~~~~~~~~~~~~~~~^~~~~
main.cpp:19:30: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
19 | for (i = 1, j <= n, i++)
| ~^~
main.cpp:25:9: error: expected primary-expression before 'if'
25 | if (maxi < contor)
| ^~
main.cpp:24:14: error: expected ';' before 'if'
24 | }
| ^
| ;
25 | if (maxi < contor)
| ~~
main.cpp:25:9: error: expected primary-expression before 'if'
25 | if (maxi < contor)
| ^~