#939
sum00
Să se scrie un program care citeşte de la tastatura două numere naturale şi determină suma lor.
Problema | sum00 | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54022816 | Utilizator | |
Fișier | sum00.cpp | Dimensiune | 1.93 KB |
Data încărcării | 18 Noiembrie 2024, 09:53 | Scor / rezultat | Eroare de compilare |
sum00.cpp:12:9: error: 'int y1' redeclared as different kind of symbol int x1, y1, x2, y2; ^ In file included from /usr/include/features.h:374:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/os_defines.h:39, from /usr/include/i386-linux-gnu/c++/4.8/bits/c++config.h:426, from /usr/include/c++/4.8/iostream:38, from sum00.cpp:1: /usr/include/i386-linux-gnu/bits/mathcalls.h:241:1: error: previous declaration of 'double y1(double)' __MATHCALL (y1,, (_Mdouble_)); ^ sum00.cpp: In function 'int Lee()': sum00.cpp:23:29: error: no matching function for call to 'std::queue<std::pair<int, int> >::push(std::pair<int, double (*)(double)throw ()>)' Q.push(make_pair(x1, y1)); ^ sum00.cpp:23:29: note: candidates are: In file included from /usr/include/c++/4.8/queue:64:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:85, from sum00.cpp:3: /usr/include/c++/4.8/bits/stl_queue.h:212:7: note: void std::queue<_Tp, _Sequence>::push(const value_type&) [with _Tp = std::pair<int, int>; _Sequence = std::deque<std::pair<int, int>, std::allocator<std::pair<int, int> > >; std::queue<_Tp, _Sequence>::value_type = std::pair<int, int>] push(const value_type& __x) ^ /usr/include/c++/4.8/bits/stl_queue.h:212:7: note: no known conversion for argument 1 from 'std::pair<int, double (*)(double)throw ()>' to 'const value_type& {aka const std::pair<int, int>&}' /usr/include/c++/4.8/bits/stl_queue.h:217:7: note: void std::queue<_Tp, _Sequence>::push(std::queue<_Tp, _Sequence>::value_type&&) [with _Tp = std::pair<int, int>; _Sequence = std::deque<std::pair<int, int>, std::allocator<std::pair<int, int> > >; std::queue<_Tp, _Sequence>::value_type = std::pair<int, int>] push(value_type&& __x) ^ /usr/include/c++/4.8/bits/stl_queue.h:217:7: note: no known conversion for argument 1 from 'std::pair<int, double (*)(double)throw ()>' to 'std::queue<std::pair<int, int> >::value_type&& {aka std::pair<int, int>&&}' sum00.cpp:24:13: error: invalid types 'int [101][double(double)throw ()]' for array subscript b[x1][y1] = 1; ^ sum00.cpp:25:17: error: invalid types 'bool [101][double(double)throw ()]' for array subscript verif[x1][y1] = true; ^ sum00.cpp: In function 'void initMatrix()': sum00.cpp:60:1: error: expected '(' before '}' token } ^ sum00.cpp:60:1: error: expected primary-expression before '}' token sum00.cpp:60:1: error: expected ';' before '}' token sum00.cpp:60:1: error: expected primary-expression before '}' token sum00.cpp:60:1: error: expected ';' before '}' token sum00.cpp:60:1: error: expected primary-expression before '}' token sum00.cpp:60:1: error: expected ')' before '}' token sum00.cpp:60:1: error: expected primary-expression before '}' token sum00.cpp:60:1: error: expected ';' before '}' token sum00.cpp: In function 'void citire()': sum00.cpp:78:9: error: cannot bind 'std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}' lvalue to 'std::basic_istream<char>&&' fin >> x1 >> y1 >> x2 >> y2; ^ In file included from /usr/include/c++/4.8/iostream:40:0, from sum00.cpp:1: /usr/include/c++/4.8/istream:872:5: error: initializing argument 1 of 'std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&&, _Tp&) [with _CharT = char; _Traits = std::char_traits<char>; _Tp = double(double)throw ()]' operator>>(basic_istream<_CharT, _Traits>&& __is, _Tp& __x) ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema sum00 face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:
Suma punctajelor acordate pe testele utilizate pentru verificare este 100. Astfel, soluția ta poate obține cel mult 100 de puncte, caz în care se poate considera corectă.