#2441
O pereche de cuvinte, unul cu număr par de litere, iar celălalt cu număr impar de litere, se numește descentrată dacă se poate obține cuvântul cu număr par de litere din celălalt, prin duplicarea caracterului din mijlocul acestuia. Să se determine dacă există perechi descentrate de cuvinte.
simulare bacalaureat 2018
| Problema | pereche descentrata | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64161318 | Utilizator | |
| Fișier | pereche_descentrata.cpp | Dimensiune | 912 B |
| Data încărcării | 21 Aprilie 2026, 09:19 | Scor/rezultat | Eroare de compilare |
pereche_descentrata.cpp: In function ‘int main()’: pereche_descentrata.cpp:6:29: error: expected initializer before ‘*’ token 6 | char s[101],szo[50][101]*p; | ^ pereche_descentrata.cpp:12:5: error: ‘p’ was not declared in this scope 12 | p=strtok(s, " "); | ^ pereche_descentrata.cpp:13:5: warning: this ‘while’ clause does not guard... [-Wmisleading-indentation] 13 | while(p); | ^~~~~ pereche_descentrata.cpp:14:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘while’ 14 | { | ^ pereche_descentrata.cpp:15:17: error: ‘szo’ was not declared in this scope 15 | strcopy(szo[k],p); | ^~~ pereche_descentrata.cpp:15:9: error: ‘strcopy’ was not declared in this scope; did you mean ‘strcpy’? 15 | strcopy(szo[k],p); | ^~~~~~~ | strcpy pereche_descentrata.cpp:22:19: error: ‘szo’ was not declared in this scope 22 | if(strlen(szo[i])%2==1) | ^~~ pereche_descentrata.cpp:36:27: error: ‘szo’ was not declared in this scope 36 | if(strcmp(szo[i],szo[j])==0 and paratlan[i]!=paratlan[j]) | ^~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema pereche descentrata 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ă.