#4756
Se citește un text format din cuvinte și separatori. Cuvintele sunt formate din litere mici ale alfabetului, iar separatorii sunt spațiul, plus caracterele din șirul '.,!?:;-.
1) Să se afișeze n – numărul de cuvinte, precum și cuvintele din text.
2) Se se afișeze cuvântul cel mai mic din punct de vedere lexicografic.
3) Să se determine numărul de cuvinte care conțin secvența ini.
4) Să se afișeze fiecare cuvânt oglindit.
5) Să se determine câte cuvinte se termină cu litera a.
6) Să se determine lungimea minimă și lungimea maximă a unui cuvânt
| Problema | textcuv | Operații I/O |
textcuv.in/textcuv.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 16 MB
/
Stivă 8 MB
|
| Id soluție | #63404976 | Utilizator | |
| Fișier | textcuv.cpp | Dimensiune | 1.92 KB |
| Data încărcării | 02 Martie 2026, 10:22 | Scor/rezultat | Eroare de compilare |
textcuv.cpp: In function 'int main()': textcuv.cpp:12:16: error: expected ')' before numeric constant f.getline(s.1001); ^ textcuv.cpp:12:21: error: no matching function for call to 'std::basic_ifstream<char>::getline(char [1001])' f.getline(s.1001); ^ textcuv.cpp:12:21: note: candidates are: In file included from /usr/include/c++/4.8/iostream:40:0, from textcuv.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 textcuv.cpp:17:9: error: expected ';' before 'p' p=strtok(NULL," .,!?:;-") ^ textcuv.cpp:32:43: warning: converting 'false' to pointer type for argument 2 of 'int strcmp(const char*, const char*)' [-Wconversion-null] if (strcmp(v[j],v[i]<0) ^ textcuv.cpp:32:43: warning: null argument where non-null required (argument 2) [-Wnonnull] textcuv.cpp:33:25: error: expected ')' before 'swap' swap(v[i],v[j]); ^ textcuv.cpp:35:17: error: expected ';' before 'break' break; ^ textcuv.cpp:49:21: error: 'l' was not declared in this scope l=strlen(v[i]) ^ textcuv.cpp:50:21: error: expected ';' before 'for' for (j=l-i; j>=0; j--) ^ textcuv.cpp:50:34: warning: statement has no effect [-Wunused-value] for (j=l-i; j>=0; j--) ^ textcuv.cpp:50:42: error: expected ';' before ')' token for (j=l-i; j>=0; j--) ^ textcuv.cpp:58:25: error: 'l' was not declared in this scope l=strlen(v[i]); ^ textcuv.cpp:68:42: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (strlen(v[i])<lmin) lmin=strlen(v[i]); ^ textcuv.cpp:69:42: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (strlen(v[i])>lmax) lmax=strlen(v[i]); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema textcuv 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ă.