#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 | #54945598 | Utilizator | |
Fișier | inlocuirecuvant.cpp | Dimensiune | 577 B |
Data încărcării | 13 Decembrie 2024, 08:40 | Scor / rezultat | Eroare de compilare |
inlocuirecuvant.cpp: In function 'int main()': inlocuirecuvant.cpp:14:23: error: no matching function for call to 'getline(char [512], int)' fin>>getline(s,101); ^ inlocuirecuvant.cpp:14:23: note: candidates are: In file included from /usr/include/stdio.h:934:0, from /usr/include/c++/4.8/cstdio:42, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:46, from inlocuirecuvant.cpp:1: /usr/include/i386-linux-gnu/bits/stdio.h:115:1: note: __ssize_t getline(char**, size_t*, FILE*) getline (char **__lineptr, size_t *__n, FILE *__stream) ^ /usr/include/i386-linux-gnu/bits/stdio.h:115:1: note: candidate expects 3 arguments, 2 provided 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 inlocuirecuvant.cpp:1: /usr/include/c++/4.8/bits/basic_string.h:2793:5: note: template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::getline(std::basic_istream<_CharT, _Traits>&, std::basic_string<_CharT, _Traits, _Alloc>&) getline(basic_istream<_CharT, _Traits>& __is, ^ /usr/include/c++/4.8/bits/basic_string.h:2793:5: note: template argument deduction/substitution failed: inlocuirecuvant.cpp:14:23: note: mismatched types 'std::basic_istream<_CharT, _Traits>' and 'char [512]' fin>>getline(s,101); ^ In file included from /usr/include/c++/4.8/string:53: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 inlocuirecuvant.cpp:1: /usr/include/c++/4.8/bits/basic_string.tcc:1068:5: note: template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::getline(std::basic_istream<_CharT, _Traits>&, std::basic_string<_CharT, _Traits, _Alloc>&, _CharT) getline(basic_istream<_CharT, _Traits>& __in, ^ /usr/include/c++/4.8/bits/basic_string.tcc:1068:5: note: template argument deduction/substitution failed: inlocuirecuvant.cpp:14:23: note: mismatched types 'std::basic_istream<_CharT, _Traits>' and 'char [512]' fin>>getline(s,101); ^ inlocuirecuvant.cpp:9:9: warning: unused variable 'i' [-Wunused-variable] int i; ^
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ă.