#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 | #64605943 | Utilizator | |
| Fișier | anagrame.cpp | Dimensiune | 443 B |
| Data încărcării | 18 Mai 2026, 11:43 | Scor/rezultat | 50 puncte |
anagrame.cpp: In function ‘int main()’: anagrame.cpp:11:15: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare] 11 | for(i=0; i<strlen(s1); i++) | ~^~~~~~~~~~~ anagrame.cpp:13:15: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare] 13 | for(i=0; i<strlen(s2); i++) | ~^~~~~~~~~~~ anagrame.cpp:16:16: warning: iteration 21 invokes undefined behavior [-Waggressive-loop-optimizations] 16 | if(v1[i]!=v2[i]) | ~~~~^ anagrame.cpp:15:15: note: within this loop 15 | for(i=0; i<256; i++) | ~^~~~
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.001 secunde | Raspuns gresit. | 10 | 0 | Exemplu | |
| 2 | 0.001 secunde | Raspuns gresit. | 10 | 0 | ||
| 3 | 0.001 secunde | OK. | 20 | 20 | ||
| 4 | 0.001 secunde | OK. | 20 | 20 | ||
| 5 | 0.001 secunde | Raspuns gresit. | 20 | 0 | ||
| 6 | 0.001 secunde | Raspuns gresit. | 10 | 0 | ||
| 7 | 0.001 secunde | OK. | 10 | 10 | ||
| Punctaj total | 50 | |||||
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ă.