#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 | #56952267 | Utilizator | |
Fișier | textcuv.cpp | Dimensiune | 1.13 KB |
Data încărcării | 11 Martie 2025, 16:07 | Scor / rezultat | Eroare de compilare |
textcuv.cpp:4:1: error: 'ifstream' does not name a type ifstream fin("textcuv.in") ^ textcuv.cpp: In function 'int main()': textcuv.cpp:11:5: error: 'fin' was not declared in this scope fin>>t; ^ textcuv.cpp:17:22: error: invalid conversion from 'int' to 'char*' [-fpermissive] strcpy(minim,p); ^ 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 textcuv.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)) ^ textcuv.cpp:20:8: error: expected ';' before 'nra' nra=0; ^ textcuv.cpp:28:29: error: invalid conversion from 'int' to 'const char*' [-fpermissive] if(strcmp(p,minim)<0) ^ In file included from /usr/include/c++/4.8/cstring:42:0, from textcuv.cpp:2: /usr/include/string.h:144:12: error: initializing argument 2 of 'int strcmp(const char*, const char*)' [-fpermissive] extern int strcmp (const char *__s1, const char *__s2) ^ textcuv.cpp:29:27: error: invalid conversion from 'int' to 'char*' [-fpermissive] strcpy(minim,p); ^ 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 textcuv.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)) ^ textcuv.cpp:33:29: error: expected ']' before ')' token if(p[strlen(p)-1)]=='a') ^ textcuv.cpp:33:30: error: expected primary-expression before ']' token if(p[strlen(p)-1)]=='a') ^ textcuv.cpp:33:30: error: expected ';' before ']' token textcuv.cpp:37:20: error: expected primary-expression before ')' token if() ^ textcuv.cpp:39:8: error: expected primary-expression before '}' token } ^ textcuv.cpp:39:8: error: expected ';' before '}' token textcuv.cpp:43:12: error: 'cout' was not declared in this scope cout<<nr<<endl; ^ textcuv.cpp:43:12: note: suggested alternative: In file included from textcuv.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ textcuv.cpp:43:22: error: 'endl' was not declared in this scope cout<<nr<<endl; ^ textcuv.cpp:43:22: note: suggested alternative: In file included from /usr/include/c++/4.8/iostream:39:0, from textcuv.cpp:1: /usr/include/c++/4.8/ostream:564:5: note: 'std::endl' endl(basic_ostream<_CharT, _Traits>& __os) ^ textcuv.cpp:48:13: error: 'cout' was not declared in this scope cout<<minim; ^ textcuv.cpp:48:13: note: suggested alternative: In file included from textcuv.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ textcuv.cpp:50:13: error: 'cout' was not declared in this scope cout<<nri; ^ textcuv.cpp:50:13: note: suggested alternative: In file included from textcuv.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ textcuv.cpp:53:20: error: 'j' was not declared in this scope for(j=0;) ^ textcuv.cpp:53:24: error: expected primary-expression before ')' token for(j=0;) ^ textcuv.cpp:53:24: error: expected ';' before ')' token textcuv.cpp:53:24: error: expected statement at end of input textcuv.cpp:53:24: error: expected '}' at end of input textcuv.cpp:53:24: error: expected '}' at end of input textcuv.cpp:53:24: error: expected '}' at end of input
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ă.