#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 | #64693539 | Utilizator | |
| Fișier | anagrame.cpp | Dimensiune | 481 B |
| Data încărcării | 23 Mai 2026, 21:44 | Scor/rezultat | 30 puncte |
anagrame.cpp: In function ‘int main()’: anagrame.cpp:14:19: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare] 14 | for (int i=0;i<=strlen(s)-1;i++){ | ~^~~~~~~~~~~~~ anagrame.cpp:13:1: warning: this ‘else’ clause does not guard... [-Wmisleading-indentation] 13 | else | ^~~~ anagrame.cpp:22:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘else’ 22 | cout<<ok; | ^~~~ In file included from /usr/include/string.h:548, from /usr/include/c++/13/cstring:42, from anagrame.cpp:2: In function ‘char* strcpy(char*, const char*)’, inlined from ‘int main()’ at anagrame.cpp:20:15: /usr/include/x86_64-linux-gnu/bits/string_fortified.h:79:33: warning: ‘char* __builtin___strcpy_chk(char*, const char*, long unsigned int)’ accessing 1 byte at offsets [0, 21] and [0, 21] overlaps 1 byte at offset [0, 20] [-Wrestrict] 79 | return __builtin___strcpy_chk (__dest, __src, __glibc_objsize (__dest)); | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.001 secunde | OK. | 10 | 10 | Exemplu | |
| 2 | 0.001 secunde | Raspuns gresit. | 10 | 0 | ||
| 3 | 0.001 secunde | OK. | 20 | 20 | ||
| 4 | 0.001 secunde | Caught fatal signal 6 | 20 | 0 | ||
| 5 | 0.001 secunde | Raspuns gresit. | 20 | 0 | ||
| 6 | 0.001 secunde | Raspuns gresit. | 10 | 0 | ||
| 7 | 0.002 secunde | Raspuns gresit. | 10 | 0 | ||
| Punctaj total | 30 | |||||
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ă.