#97
Să se scrie un program care verifică dacă două cuvinte date sunt anagrame.
| Problema | Anagrame | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64826360 | Utilizator | |
| Fișier | anagrame.cpp | Dimensiune | 870 B |
| Data încărcării | 04 Iunie 2026, 01:14 | Scor/rezultat | 100 puncte |
anagrame.cpp: In function ‘int main()’: anagrame.cpp:22:19: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare] 22 | for(i=0; i<strlen(s); i++){ | ~^~~~~~~~~~ anagrame.cpp:8:10: warning: unused variable ‘sb’ [-Wunused-variable] 8 | char sb[1000],a[1000],s[1000],x; | ^~ anagrame.cpp:11:15: warning: ‘i’ may be used uninitialized [-Wmaybe-uninitialized] 11 | while(i<n && oks==1){ | ~~~~^~~~~~~~~ anagrame.cpp:7:11: note: ‘i’ was declared here 7 | int n,i,k,ok=1,oks=1; | ^ anagrame.cpp:19:8: warning: ‘k’ may be used uninitialized [-Wmaybe-uninitialized] 19 | s[k-1]='\0'; | ~^~ anagrame.cpp:7:13: note: ‘k’ was declared here 7 | int n,i,k,ok=1,oks=1; | ^
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.001 secunde | OK. | 10 | 10 | Exemplu | |
| 2 | 0.002 secunde | OK. | 10 | 10 | ||
| 3 | 0.001 secunde | OK. | 20 | 20 | ||
| 4 | 0.001 secunde | OK. | 20 | 20 | ||
| 5 | 0.001 secunde | OK. | 20 | 20 | ||
| 6 | 0.001 secunde | OK. | 10 | 10 | ||
| 7 | 0.001 secunde | OK. | 10 | 10 | ||
| Punctaj total | 100 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Anagrame 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ă.