#256
FiboVerif
Se dau n
numere naturale. Să se verifice despre fiecare dacă este termen al şirului lui Fibonacci.
Problema | FiboVerif | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #51793577 | Utilizator | |
Fișier | fiboverif.cpp | Dimensiune | 553 B |
Data încărcării | 20 August 2024, 19:54 | Scor / rezultat | Eroare de compilare |
fiboverif.cpp: In function 'int main()': fiboverif.cpp:30:29: error: invalid user-defined conversion from 'const char' to 'const string& {aka const std::basic_string<char>&}' [-fpermissive] for(const string &rez : rez) ^ In file included from /usr/include/c++/4.8/string:52:0, from /usr/include/c++/4.8/bits/locale_classes.h:40, from /usr/include/c++/4.8/bits/ios_base.h:41, from /usr/include/c++/4.8/ios:42, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/sstream:38, from /usr/include/c++/4.8/complex:45, from /usr/include/c++/4.8/ccomplex:38, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52, from fiboverif.cpp:1: /usr/include/c++/4.8/bits/basic_string.h:490:7: note: candidate is: std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>] <near match> basic_string(const _CharT* __s, const _Alloc& __a = _Alloc()); ^ /usr/include/c++/4.8/bits/basic_string.h:490:7: note: no known conversion for argument 1 from 'const char' to 'const char*' fiboverif.cpp:30:29: error: invalid conversion from 'char' to 'const char*' [-fpermissive] for(const string &rez : rez) ^ In file included from /usr/include/c++/4.8/string:52:0, from /usr/include/c++/4.8/bits/locale_classes.h:40, from /usr/include/c++/4.8/bits/ios_base.h:41, from /usr/include/c++/4.8/ios:42, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/sstream:38, from /usr/include/c++/4.8/complex:45, from /usr/include/c++/4.8/ccomplex:38, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52, from fiboverif.cpp:1: /usr/include/c++/4.8/bits/basic_string.h:490:7: error: initializing argument 1 of 'std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' [-fpermissive] basic_string(const _CharT* __s, const _Alloc& __a = _Alloc()); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema FiboVerif 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ă.