#2681
Se citește un șir de caractere reprezentând o propoziție care conține litere mari și mici ale alfabetului englez, spații, cifre și alte simboluri. În cele ce urmează, considerăm cuvânt orice secvență delimitată de spații ce conține cel puțin o literă.
Se se afișeze șirul citit astfel încât cuvintele de lungime maximă să fie înlocuite cu inversul (oglinditul) lor, restul cuvintelor și aranjarea lor în propoziție să rămână neschimbate.
| Problema | InversMax | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64963494 | Utilizator | |
| Fișier | inversmax.cpp | Dimensiune | 1.40 KB |
| Data încărcării | 26 Iunie 2026, 12:09 | Scor/rezultat | 100 puncte |
inversmax.cpp: In function ‘int main()’: inversmax.cpp:25:22: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 25 | for(int i = 0; i <= s.size(); i++) | ~~^~~~~~~~~~~ inversmax.cpp:27:14: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 27 | if(i < s.size() && s[i] != ' ') | ~~^~~~~~~~~~ inversmax.cpp:47:22: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 47 | for(int i = 0; i <= s.size(); i++) | ~~^~~~~~~~~~~ inversmax.cpp:49:14: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 49 | if(i < s.size() && s[i] != ' ') | ~~^~~~~~~~~~ inversmax.cpp:57:43: warning: comparison of integer expressions of different signedness: ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare] 57 | if(valid[j] && cuv.size() == maxLen) | ~~~~~~~~~~~^~~~~~~~~ inversmax.cpp:65:18: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 65 | if(i < s.size()) | ~~^~~~~~~~~~
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.002 secunde | OK. | 20 | 20 | Exemplu | |
| 2 | 0.001 secunde | OK. | 20 | 20 | ||
| 3 | 0.001 secunde | OK. | 20 | 20 | ||
| 4 | 0.001 secunde | OK. | 20 | 20 | ||
| 5 | 0.001 secunde | OK. | 20 | 20 | ||
| Punctaj total | 100 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema InversMax 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ă.