#1005
Se dă o listă cu numere naturale. Să se determine numerele naturale nenule cu cel mult patru cifre care nu apar în lista dată.
| Problema | Numere8 | Operații I/O |
numere8.in/numere8.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64262336 | Utilizator | |
| Fișier | numere8.cpp | Dimensiune | 301 B |
| Data încărcării | 27 Aprilie 2026, 08:28 | Scor/rezultat | Eroare de compilare |
numere8.cpp:5:1: error: expected ‘,’ or ‘;’ before ‘ofstream’ 5 | ofstream fout (" numere8.out"); | ^~~~~~~~ numere8.cpp: In function ‘int main()’: numere8.cpp:8:18: error: array must be initialized with a brace-enclosed initializer 8 | int ap [10001]=0, x; | ^ numere8.cpp:9:13: error: no match for ‘operator<=’ (operand types are ‘std::ifstream’ {aka ‘std::basic_ifstream<char>’} and ‘int’) 9 | while (fin<=10000) | ~~~^~~~~~~ | | | | | int | std::ifstream {aka std::basic_ifstream<char>} numere8.cpp:9:13: note: candidate: ‘operator<=(int, int)’ (built-in) 9 | while (fin<=10000) | ~~~^~~~~~~ numere8.cpp:9:13: note: no known conversion for argument 1 from ‘std::ifstream’ {aka ‘std::basic_ifstream<char>’} to ‘int’ In file included from /usr/include/c++/13/string:48, from /usr/include/c++/13/bits/locale_classes.h:40, from /usr/include/c++/13/bits/ios_base.h:41, from /usr/include/c++/13/ios:44, from /usr/include/c++/13/ostream:40, from /usr/include/c++/13/iostream:41, from numere8.cpp:1: /usr/include/c++/13/bits/stl_iterator.h:476:5: note: candidate: ‘template<class _Iterator> bool std::operator<=(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)’ 476 | operator<=(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/13/bits/stl_iterator.h:476:5: note: template argument deduction/substitution failed: numere8.cpp:9:15: note: ‘std::ifstream’ {aka ‘std::basic_ifstream<char>’} is not derived from ‘const std::reverse_iterator<_Iterator>’ 9 | while (fin<=10000) | ^~~~~ /usr/include/c++/13/bits/stl_iterator.h:520:5: note: candidate: ‘template<class _IteratorL, class _IteratorR> bool std::operator<=(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)’ 520 | operator<=(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/13/bits/stl_iterator.h:520:5: note: template argument deduction/substitution failed: numere8.cpp:9:15: note: ‘std::ifstream’ {aka ‘std::basic_ifstream<char>’} is not derived from ‘const std::reverse_iterator<_Iterator>’ 9 | while (fin<=10000) | ^~~~~ /usr/include/c++/13/bits/stl_iterator.h:1715:5: note: candidate: ‘template<class _IteratorL, class _IteratorR> bool std::operator<=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)’ 1715 | operator<=(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/13/bits/stl_iterator.h:1715:5: note: template argument deduction/substitution failed: numere8.cpp:9:15: note: ‘std::ifstream’ {aka ‘std::basic_ifstream<char>’} is not derived from ‘const std::move_iterator<_IteratorL>’ 9 | while (fin<=10000) | ^~~~~ /usr/include/c++/13/bits/stl_iterator.h:1777:5: note: candidate: ‘template<class _Iterator> bool std::operator<=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)’ 1777 | operator<=(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/13/bits/stl_iterator.h:1777:5: note: template argument deduction/substitution failed: numere8.cpp:9:15: note: ‘std::ifstream’ {aka ‘std::basic_ifstream<char>’} is not derived from ‘const std::move_iterator<_IteratorL>’ 9 | while (fin<=10000) | ^~~~~ In file included from /usr/include/c++/13/bits/stl_algobase.h:64, from /usr/include/c++/13/string:51: /usr/include/c++/13/bits/stl_pair.h:854:5: note: candidate: ‘template<class _T1, class _T2> constexpr bool std::operator<=(const pair<_T1, _T2>&, const pair<_T1, _T2>&)’ 854 | operator<=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/13/bits/stl_pair.h:854:5: note: template argument deduction/substitution failed: numere8.cpp:9:15: note: ‘std::ifstream’ {aka ‘std::basic_ifstream<char>’} is not derived from ‘const std::pair<_T1, _T2>’ 9 | while (fin<=10000) | ^~~~~ In file included from /usr/include/c++/13/string:54: /usr/include/c++/13/bits/basic_string.h:3911:5: note: candidate: ‘template<class _CharT, class _Traits, class _Alloc> bool std::operator<=(const __cxx11::basic_string<_CharT, _Traits, _Alloc>&, const __cxx11::basic_string<_CharT, _Traits, _Alloc>&)’ 3911 | operator<=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/13/bits/basic_string.h:3911:5: note: template argument deduction/substitution failed: numere8.cpp:9:15: note: ‘std::ifstream’ {aka ‘std::basic_ifstream<char>’} is not derived from ‘const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>’ 9 | while (fin<=10000) | ^~~~~ /usr/include/c++/13/bits/basic_string.h:3925:5: note: candidate: ‘template<class _CharT, class _Traits, class _Alloc> bool std::operator<=(const __cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _CharT*)’ 3925 | operator<=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/13/bits/basic_string.h:3925:5: note: template argument deduction/substitution failed: numere8.cpp:9:15: note: ‘std::ifstream’ {aka ‘std::basic_ifstream<char>’} is not derived from ‘const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>’ 9 | while (fin<=10000) | ^~~~~ /usr/include/c++/13/bits/basic_string.h:3938:5: note: candidate: ‘template<class _CharT, class _Traits, class _Alloc> bool std::operator<=(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Alloc>&)’ 3938 | operator<=(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/13/bits/basic_string.h:3938:5: note: template argument deduction/substitution failed: numere8.cpp:9:15: note: mismatched types ‘const _CharT*’ and ‘std::basic_ifstream<char>’ 9 | while (fin<=10000) | ^~~~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Numere8 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ă.