#4417
Expresia este o succesiune formată din unul sau mai mulți operanzi. În expresie apar doar doi operatori, a căror semnificaţie spionul o ştia deja:
+ – concatenează două șiruri (ex: con + tact = contact)* – inserează al doilea şir după fiecare literă a primului şir (ex: Ctrm * a = Catarama)Operaţiile din expresie se execută în ordine, de la stânga la dreapta. Valoarea este un şir de caractere care reprezintă rezultatul evaluării expresiei. Scrieţi un program care, cunoscând indiciul, determină codul.
Urmașii lui Moisil 2023, clasa a X-a
| Problema | indiciu | Operații I/O |
indiciu.in/indiciu.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 2 MB
|
| Id soluție | #65020295 | Utilizator | |
| Fișier | indiciu.cpp | Dimensiune | 2.57 KB |
| Data încărcării | 16 Iulie 2026, 16:25 | Scor/rezultat | 0 puncte |
indiciu.cpp: In function ‘std::string inmultire(std::string&, std::string&)’: indiciu.cpp:18:23: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 18 | for( int i = 0; i < a.size(); i++ ){ | ~~^~~~~~~~~~ indiciu.cpp: In function ‘std::string inv_inmultire(std::string&, int)’: indiciu.cpp:27:23: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 27 | for( int i = 0; i < a.size(); i += ( len ) ){ | ~~^~~~~~~~~~ indiciu.cpp: In function ‘int solve(int)’: indiciu.cpp:39:22: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 39 | for( int i = 0; i < operatori.size(); i++ ){ | ~~^~~~~~~~~~~~~~~~~~ indiciu.cpp: In function ‘int main()’: indiciu.cpp:66:14: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 66 | while( i < stanga.size() ){ | ~~^~~~~~~~~~~~~~~ indiciu.cpp:77:19: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 77 | for( i = 1; i <= dreapta.size(); i++ ){ | ~~^~~~~~~~~~~~~~~~~ indiciu.cpp:78:22: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 78 | if( solve(i) == dreapta.size() ){ | ~~~~~~~~~^~~~~~~~~~~~~~~~~ indiciu.cpp:91:26: warning: comparison of integer expressions of different signedness: ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare] 91 | if( a.size() >= nxtl ){ | ~~~~~~~~~^~~~~~~ indiciu.cpp:101:33: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 101 | for( int j = 1; j < a.size(); j += len ) | ~~^~~~~~~~~~ indiciu.cpp:83:20: warning: ‘len’ may be used uninitialized [-Wmaybe-uninitialized] 83 | cout << len << " "; | ^~~ indiciu.cpp:59:17: note: ‘len’ was declared here 59 | int poz, i, len, nxtl; | ^~~
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.002 secunde | Raspuns gresit. | 4 | 0 | ||
| 2 | 0.002 secunde | Raspuns gresit. | 4 | 0 | ||
| 3 | 0.001 secunde | Raspuns gresit. | 4 | 0 | ||
| 4 | 0.001 secunde | Raspuns gresit. | 4 | 0 | ||
| 5 | 0.001 secunde | Raspuns gresit. | 4 | 0 | ||
| 6 | 0.001 secunde | Raspuns gresit. | 4 | 0 | ||
| 7 | 0.002 secunde | Raspuns gresit. | 4 | 0 | ||
| 8 | 0.002 secunde | Raspuns gresit. | 4 | 0 | ||
| 9 | 0.001 secunde | Raspuns gresit. | 4 | 0 | ||
| 10 | 0.001 secunde | Raspuns gresit. | 4 | 0 | ||
| 11 | 0.002 secunde | Raspuns gresit. | 4 | 0 | ||
| 12 | 0.004 secunde | Raspuns gresit. | 4 | 0 | ||
| 13 | 0.001 secunde | Raspuns gresit. | 4 | 0 | ||
| 14 | 0.001 secunde | Raspuns gresit. | 4 | 0 | ||
| 15 | 0.001 secunde | Raspuns gresit. | 4 | 0 | ||
| 16 | 0.001 secunde | Raspuns gresit. | 4 | 0 | ||
| 17 | 0.001 secunde | Raspuns gresit. | 4 | 0 | ||
| 18 | 0.001 secunde | Raspuns gresit. | 4 | 0 | ||
| 19 | 0.001 secunde | Raspuns gresit. | 4 | 0 | ||
| 20 | 0.001 secunde | Raspuns gresit. | 4 | 0 | ||
| 21 | 0.002 secunde | Raspuns gresit. | 4 | 0 | ||
| 22 | 0.001 secunde | Raspuns gresit. | 4 | 0 | ||
| 23 | 0.001 secunde | Raspuns gresit. | 4 | 0 | ||
| 24 | 0.001 secunde | Raspuns gresit. | 4 | 0 | ||
| 25 | 0.001 secunde | Raspuns gresit. | 4 | 0 | ||
| Punctaj total | 0 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema indiciu 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ă.