#2348
Caracterul mediu 1
C++
Să se determine caracterul mediu al caracterelor bune din sir .
Problema | Caracterul mediu 1 | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.03 secunde | Limita memorie |
Total: 32 MB
/
Stivă 0.1 MB
|
Id soluție | #53777182 | Utilizator | |
Fișier | caracterul_mediu_1.cpp | Dimensiune | 360 B |
Data încărcării | 11 Noiembrie 2024, 15:14 | Scor / rezultat | Eroare de compilare |
caracterul_mediu_1.cpp: In function 'int main()': caracterul_mediu_1.cpp:8:14: error: no matching function for call to 'std::basic_istream<char>::get(char [201])' cin.get(s); ^ caracterul_mediu_1.cpp:8:14: note: candidates are: In file included from /usr/include/c++/4.8/iostream:40:0, from caracterul_mediu_1.cpp:1: /usr/include/c++/4.8/istream:302:7: note: std::basic_istream<_CharT, _Traits>::int_type std::basic_istream<_CharT, _Traits>::get() [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::int_type = int] get(); ^ /usr/include/c++/4.8/istream:302:7: note: candidate expects 0 arguments, 1 provided /usr/include/c++/4.8/istream:316:7: note: std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::get(std::basic_istream<_CharT, _Traits>::char_type&) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::char_type = char] get(char_type& __c); ^ /usr/include/c++/4.8/istream:316:7: note: no known conversion for argument 1 from 'char [201]' to 'std::basic_istream<char>::char_type& {aka char&}' /usr/include/c++/4.8/istream:343:7: note: std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::get(std::basic_istream<_CharT, _Traits>::char_type*, std::streamsize, std::basic_istream<_CharT, _Traits>::char_type) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::char_type = char; std::streamsize = int] get(char_type* __s, streamsize __n, char_type __delim); ^ /usr/include/c++/4.8/istream:343:7: note: candidate expects 3 arguments, 1 provided /usr/include/c++/4.8/istream:354:7: note: std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::get(std::basic_istream<_CharT, _Traits>::char_type*, std::streamsize) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::__istream_type = std::basic_istream<char>; std::basic_istream<_CharT, _Traits>::char_type = char; std::streamsize = int] get(char_type* __s, streamsize __n) ^ /usr/include/c++/4.8/istream:354:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/4.8/istream:377:7: note: std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::get(std::basic_istream<_CharT, _Traits>::__streambuf_type&, std::basic_istream<_CharT, _Traits>::char_type) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::__streambuf_type = std::basic_streambuf<char>; std::basic_istream<_CharT, _Traits>::char_type = char] get(__streambuf_type& __sb, char_type __delim); ^ /usr/include/c++/4.8/istream:377:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/4.8/istream:387:7: note: std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::get(std::basic_istream<_CharT, _Traits>::__streambuf_type&) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::__istream_type = std::basic_istream<char>; std::basic_istream<_CharT, _Traits>::__streambuf_type = std::basic_streambuf<char>] get(__streambuf_type& __sb) ^ /usr/include/c++/4.8/istream:387:7: note: no known conversion for argument 1 from 'char [201]' to 'std::basic_istream<char>::__streambuf_type& {aka std::basic_streambuf<char>&}' caracterul_mediu_1.cpp:9:28: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(i = 0; i < strlen(s); i++) ^ caracterul_mediu_1.cpp:16:7: error: incompatible types in assignment of 'int' to 'char [2]' r = m; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Caracterul mediu 1 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ă.