#889
Se dau două propoziții formate din litere mari și mici ale alfabetului englez și spații. Să se afișeze în ordine alfabetică cuvintele care apar în ambele șiruri.
| Problema | CuvinteComune | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64710649 | Utilizator | |
| Fișier | cuvintecomune.cpp | Dimensiune | 1.18 KB |
| Data încărcării | 25 Mai 2026, 14:18 | Scor/rezultat | 100 puncte |
cuvintecomune.cpp: In function ‘int main()’: cuvintecomune.cpp:11:16: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare] 11 | for(int i=0;i<strlen(a);i++) | ~^~~~~~~~~~ cuvintecomune.cpp:13:16: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare] 13 | for(int i=0;i<strlen(b);i++) | ~^~~~~~~~~~ cuvintecomune.cpp:21:14: warning: array subscript has type ‘char’ [-Wchar-subscripts] 21 | strcpy(m[i],p); | ^ cuvintecomune.cpp:41:17: warning: array subscript has type ‘char’ [-Wchar-subscripts] 41 | if(strcmp(m[i],m[j])>0) | ^ cuvintecomune.cpp:45:21: warning: array subscript has type ‘char’ [-Wchar-subscripts] 45 | strcpy(m[j],m[i]); | ^ cuvintecomune.cpp:46:16: warning: array subscript has type ‘char’ [-Wchar-subscripts] 46 | strcpy(m[i],g); | ^ cuvintecomune.cpp:52:17: warning: array subscript has type ‘char’ [-Wchar-subscripts] 52 | if(strcmp(n[i],n[j])>0) | ^ cuvintecomune.cpp:56:21: warning: array subscript has type ‘char’ [-Wchar-subscripts] 56 | strcpy(n[j],n[i]); | ^ cuvintecomune.cpp:57:16: warning: array subscript has type ‘char’ [-Wchar-subscripts] 57 | strcpy(n[i],g); | ^ cuvintecomune.cpp:64:16: warning: array subscript has type ‘char’ [-Wchar-subscripts] 64 | if(strcmp(m[i],n[j])>0)j++; | ^ cuvintecomune.cpp:65:21: warning: array subscript has type ‘char’ [-Wchar-subscripts] 65 | else if(strcmp(m[i],n[j])<0) i++; | ^ cuvintecomune.cpp:66:22: warning: array subscript has type ‘char’ [-Wchar-subscripts] 66 | else if(strcmp(m[i],n[j])==0) { | ^ cuvintecomune.cpp:67:15: warning: array subscript has type ‘char’ [-Wchar-subscripts] 67 | cout<<m[i]<<endl; | ^ cuvintecomune.cpp:68:33: warning: array subscript has type ‘char’ [-Wchar-subscripts] 68 | while(j<=y&&strcmp(n[j],m[i])==0)j++; | ^
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.001 secunde | OK. | 20 | 20 | Exemplu | |
| 2 | 0.001 secunde | OK. | 40 | 40 | ||
| 3 | 0.002 secunde | OK. | 40 | 40 | ||
| Punctaj total | 100 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema CuvinteComune 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ă.