#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 | #63645502 | Utilizator | |
| Fișier | textcuv.cpp | Dimensiune | 996 B |
| Data încărcării | 12 Martie 2026, 13:47 | Scor/rezultat | Eroare de compilare |
textcuv.cpp: In function 'int main()': textcuv.cpp:12:5: error: 'fin' was not declared in this scope fin>>t; ^ textcuv.cpp:17:22: error: invalid conversion from 'char' to 'char*' [-fpermissive] strcpy(v[i],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 '}' token } ^ textcuv.cpp:25:18: error: 'fout' was not declared in this scope fout<<v[i]<<endl;} ^ textcuv.cpp:28:9: error: 'j' was not declared in this scope for(j=1+i;j<=c;j++) ^ textcuv.cpp:30:13: error: 'aux' was not declared in this scope {strcpy(aux,v[i]); ^ textcuv.cpp:37:2: error: 'ct' was not declared in this scope {ct=0; ^ textcuv.cpp:39:26: error: call of overloaded 'strchr(char&, const char [4])' is ambiguous {if(strchr(v[i],"ini")==NULL) ct++; ^ textcuv.cpp:39:26: note: candidates are: In file included from /usr/include/c++/4.8/cstring:42:0, from textcuv.cpp:2: /usr/include/string.h:223:1: note: char* strchr(char*, int) <near match> strchr (char *__s, int __c) __THROW ^ /usr/include/string.h:223:1: note: no known conversion for argument 2 from 'const char [4]' to 'int' /usr/include/string.h:229:1: note: const char* strchr(const char*, int) <near match> strchr (const char *__s, int __c) __THROW ^ /usr/include/string.h:229:1: note: no known conversion for argument 2 from 'const char [4]' to 'int' textcuv.cpp:44:38: error: 'strrev' was not declared in this scope { for(i=1;i<=c;i++) cout<<strrev(v[i])<<endl; ^ textcuv.cpp:48:2: error: 'n' was not declared in this scope {n=strlen(v[i]); ^ textcuv.cpp:48:14: error: invalid conversion from 'char' to 'const char*' [-fpermissive] {n=strlen(v[i]); ^ In file included from /usr/include/c++/4.8/cstring:42:0, from textcuv.cpp:2: /usr/include/string.h:399:15: error: initializing argument 1 of 'size_t strlen(const char*)' [-fpermissive] extern size_t strlen (const char *__s) ^ textcuv.cpp:49:6: error: 'lmax' was not declared in this scope if(n>lmax) lmax=n; ^ textcuv.cpp:50:6: error: 'lmin' was not declared in this scope if(n<lmin) lmin=n; ^ textcuv.cpp:52:7: error: expected primary-expression before '<' token cout<<<lmin<<" "<<lmax; ^ textcuv.cpp:52:8: error: 'lmin' was not declared in this scope cout<<<lmin<<" "<<lmax; ^ textcuv.cpp:52:19: error: 'lmax' was not declared in this scope cout<<<lmin<<" "<<lmax; ^ textcuv.cpp:58:2: error: expected '}' at end of input } ^ textcuv.cpp:58:2: 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ă.