#2081
Se citesc numere până când nu mai este niciun număr de citit. Se cere să se afișeze valoarea maximă dintre acestea.
| Problema | Parsare | Operații I/O |
parsare.in/parsare.out
|
|---|---|---|---|
| Limita timp | 0.7 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64182520 | Utilizator | |
| Fișier | parsare.cpp | Dimensiune | 915 B |
| Data încărcării | 21 Aprilie 2026, 22:35 | Scor/rezultat | Eroare de compilare |
parsare.cpp: In function ‘char getch()’: parsare.cpp:11:16: error: no matching function for call to ‘std::basic_istream<char>::get(int [10001], const int&)’ 11 | cin.get(buffer, BUFFER); | ~~~~~~~^~~~~~~~~~~~~~~~ In file included from /usr/include/c++/13/sstream:40, from /usr/include/c++/13/complex:45, from /usr/include/c++/13/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:127, from parsare.cpp:1: /usr/include/c++/13/istream:467:7: note: candidate: ‘std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::get(__streambuf_type&, char_type) [with _CharT = char; _Traits = std::char_traits<char>; __streambuf_type = std::basic_streambuf<char>; char_type = char]’ 467 | get(__streambuf_type& __sb, char_type __delim); | ^~~ /usr/include/c++/13/istream:467:29: note: no known conversion for argument 1 from ‘int [10001]’ to ‘std::basic_istream<char>::__streambuf_type&’ {aka ‘std::basic_streambuf<char>&’} 467 | get(__streambuf_type& __sb, char_type __delim); | ~~~~~~~~~~~~~~~~~~^~~~ /usr/include/c++/13/istream:392:7: note: candidate: ‘std::basic_istream<_CharT, _Traits>::int_type std::basic_istream<_CharT, _Traits>::get() [with _CharT = char; _Traits = std::char_traits<char>; int_type = int]’ 392 | get(); | ^~~ /usr/include/c++/13/istream:392:7: note: candidate expects 0 arguments, 2 provided /usr/include/c++/13/istream:406:7: note: candidate: ‘std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::get(char_type&) [with _CharT = char; _Traits = std::char_traits<char>; char_type = char]’ 406 | get(char_type& __c); | ^~~ /usr/include/c++/13/istream:406:7: note: candidate expects 1 argument, 2 provided /usr/include/c++/13/istream:433:7: note: candidate: ‘std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::get(char_type*, std::streamsize, char_type) [with _CharT = char; _Traits = std::char_traits<char>; char_type = char; std::streamsize = long int]’ 433 | get(char_type* __s, streamsize __n, char_type __delim); | ^~~ /usr/include/c++/13/istream:433:7: note: candidate expects 3 arguments, 2 provided /usr/include/c++/13/istream:444:7: note: candidate: ‘std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::get(char_type*, std::streamsize) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; char_type = char; std::streamsize = long int]’ 444 | get(char_type* __s, streamsize __n) | ^~~ /usr/include/c++/13/istream:444:22: note: no known conversion for argument 1 from ‘int [10001]’ to ‘std::basic_istream<char>::char_type*’ {aka ‘char*’} 444 | get(char_type* __s, streamsize __n) | ~~~~~~~~~~~^~~ /usr/include/c++/13/istream:477:7: note: candidate: ‘std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::get(__streambuf_type&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __streambuf_type = std::basic_streambuf<char>]’ 477 | get(__streambuf_type& __sb) | ^~~ /usr/include/c++/13/istream:477:7: note: candidate expects 1 argument, 2 provided parsare.cpp:12:19: error: cannot convert ‘int*’ to ‘const char*’ 12 | if(strlen(buffer) == 0) | ^~~~~~ | | | int* In file included from /usr/include/c++/13/cstring:42, from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:121: /usr/include/string.h:407:35: note: initializing argument 1 of ‘size_t strlen(const char*)’ 407 | extern size_t strlen (const char *__s) | ~~~~~~~~~~~~^~~ parsare.cpp: In function ‘void read_int()’: parsare.cpp:28:33: error: expected ‘;’ before ‘if’ 28 | }while(c ==' ' || c == '\n') | ^ | ; 29 | if(c == '\0') | ~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Parsare 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ă.