#1261
| Problema | CatePare | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64229477 | Utilizator | |
| Fișier | catepare.cpp | Dimensiune | 172 B |
| Data încărcării | 24 Aprilie 2026, 09:01 | Scor/rezultat | Eroare de compilare |
catepare.cpp: In function ‘int main()’: catepare.cpp:7:14: error: no match for ‘operator&’ (operand types are ‘std::basic_istream<char>::__istream_type’ {aka ‘std::basic_istream<char>’} and ‘bool’) 7 | cin >> x & x<0 | ~~~~~~~~ ^ ~~~ | | | | | bool | std::basic_istream<char>::__istream_type {aka std::basic_istream<char>} catepare.cpp:7:14: note: candidate: ‘operator&(int, int)’ (built-in) 7 | cin >> x & x<0 | ~~~~~~~~~^~~~~ catepare.cpp:7:14: note: no known conversion for argument 1 from ‘std::basic_istream<char>::__istream_type’ {aka ‘std::basic_istream<char>’} to ‘int’ In file included from /usr/include/c++/13/ios:44, from /usr/include/c++/13/ostream:40, from /usr/include/c++/13/iostream:41, from catepare.cpp:1: /usr/include/c++/13/bits/ios_base.h:83:3: note: candidate: ‘constexpr std::_Ios_Fmtflags std::operator&(_Ios_Fmtflags, _Ios_Fmtflags)’ 83 | operator&(_Ios_Fmtflags __a, _Ios_Fmtflags __b) | ^~~~~~~~ /usr/include/c++/13/bits/ios_base.h:83:27: note: no known conversion for argument 1 from ‘std::basic_istream<char>::__istream_type’ {aka ‘std::basic_istream<char>’} to ‘std::_Ios_Fmtflags’ 83 | operator&(_Ios_Fmtflags __a, _Ios_Fmtflags __b) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/13/bits/ios_base.h:126:3: note: candidate: ‘constexpr std::_Ios_Openmode std::operator&(_Ios_Openmode, _Ios_Openmode)’ 126 | operator&(_Ios_Openmode __a, _Ios_Openmode __b) | ^~~~~~~~ /usr/include/c++/13/bits/ios_base.h:126:27: note: no known conversion for argument 1 from ‘std::basic_istream<char>::__istream_type’ {aka ‘std::basic_istream<char>’} to ‘std::_Ios_Openmode’ 126 | operator&(_Ios_Openmode __a, _Ios_Openmode __b) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/13/bits/ios_base.h:166:3: note: candidate: ‘constexpr std::_Ios_Iostate std::operator&(_Ios_Iostate, _Ios_Iostate)’ 166 | operator&(_Ios_Iostate __a, _Ios_Iostate __b) | ^~~~~~~~ /usr/include/c++/13/bits/ios_base.h:166:26: note: no known conversion for argument 1 from ‘std::basic_istream<char>::__istream_type’ {aka ‘std::basic_istream<char>’} to ‘std::_Ios_Iostate’ 166 | operator&(_Ios_Iostate __a, _Ios_Iostate __b) | ~~~~~~~~~~~~~^~~ catepare.cpp:7:17: warning: suggest parentheses around comparison in operand of ‘&’ [-Wparentheses] 7 | cin >> x & x<0 | ~^~ catepare.cpp:14:2: error: expected ‘}’ at end of input 14 | } | ^ catepare.cpp:4:12: note: to match this ‘{’ 4 | int main() { | ^ catepare.cpp:5:12: warning: unused variable ‘k’ [-Wunused-variable] 5 | int x, k = 0; | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema CatePare 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ă.