#188
InlocuireCuvant
Se dau două cuvinte şi o propoziţie. Să se înlocuiască în propoziţie fiecare apariţie a primului cuvânt cu al doilea.
Problema | InlocuireCuvant | Operații I/O |
inlocuirecuvant.in /inlocuirecuvant.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #53893360 | Utilizator | |
Fișier | inlocuirecuvant.cpp | Dimensiune | 447 B |
Data încărcării | 14 Noiembrie 2024, 09:43 | Scor / rezultat | Eroare de compilare |
inlocuirecuvant.cpp: In function 'int main()': inlocuirecuvant.cpp:10:18: error: no matching function for call to 'std::basic_ifstream<char>::getline(char*&)' fin.getline(a); ^ inlocuirecuvant.cpp:10:18: note: candidates are: In file included from /usr/include/c++/4.8/iostream:40:0, from inlocuirecuvant.cpp:1: /usr/include/c++/4.8/istream:618:5: note: std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::getline(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] basic_istream<char>:: ^ /usr/include/c++/4.8/istream:618:5: note: candidate expects 3 arguments, 1 provided /usr/include/c++/4.8/istream:427:7: note: std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::getline(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] getline(char_type* __s, streamsize __n) ^ /usr/include/c++/4.8/istream:427:7: note: candidate expects 2 arguments, 1 provided inlocuirecuvant.cpp:11:18: error: no matching function for call to 'std::basic_ifstream<char>::getline(char*&)' fin.getline(b); ^ inlocuirecuvant.cpp:11:18: note: candidates are: In file included from /usr/include/c++/4.8/iostream:40:0, from inlocuirecuvant.cpp:1: /usr/include/c++/4.8/istream:618:5: note: std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::getline(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] basic_istream<char>:: ^ /usr/include/c++/4.8/istream:618:5: note: candidate expects 3 arguments, 1 provided /usr/include/c++/4.8/istream:427:7: note: std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::getline(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] getline(char_type* __s, streamsize __n) ^ /usr/include/c++/4.8/istream:427:7: note: candidate expects 2 arguments, 1 provided inlocuirecuvant.cpp:13:20: error: invalid conversion from 'char*' to 'char' [-fpermissive] *p=strtok(s," "); ^ inlocuirecuvant.cpp:14:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int i=0;i<strlen(s);i++) ^ inlocuirecuvant.cpp:16:22: error: invalid conversion from 'char*' to 'int' [-fpermissive] if(strchr(s,a)!=NULL) ^ In file included from /usr/include/c++/4.8/cstring:42:0, from inlocuirecuvant.cpp:3: /usr/include/string.h:223:1: error: initializing argument 2 of 'char* strchr(char*, int)' [-fpermissive] strchr (char *__s, int __c) __THROW ^ inlocuirecuvant.cpp:17:23: error: invalid conversion from 'char' to 'char*' [-fpermissive] strcpy(p[i],b); ^ In file included from /usr/include/features.h:374:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/os_defines.h:39, from /usr/include/i386-linux-gnu/c++/4.8/bits/c++config.h:426, from /usr/include/c++/4.8/iostream:38, from inlocuirecuvant.cpp:1: /usr/include/i386-linux-gnu/bits/string3.h:102:1: error: initializing argument 1 of 'char* strcpy(char*, const char*)' [-fpermissive] __NTH (strcpy (char *__restrict __dest, const char *__restrict __src)) ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema InlocuireCuvant 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ă.