#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 | #64155483 | Utilizator | |
| Fișier | anagrame.cpp | Dimensiune | 550 B |
| Data încărcării | 20 Aprilie 2026, 19:58 | Scor/rezultat | 70 puncte |
anagrame.cpp: In function ‘int main()’: anagrame.cpp:13:9: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 13 | if(s[i]>'a' && s[i]<'z') | ^~ anagrame.cpp:15:13: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 15 | l=(char)(i+'a'); | ^ anagrame.cpp:19:9: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 19 | if(r[i]>'a' && r[i]<'z') | ^~ anagrame.cpp:21:13: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 21 | m=(char)(i+'a'); | ^ anagrame.cpp:8:35: warning: unused variable ‘ok’ [-Wunused-variable] 8 | int ap[41]= {0}, ar[41]= {0}, ok=0; | ^~ anagrame.cpp:24:9: warning: ‘l’ may be used uninitialized [-Wmaybe-uninitialized] 24 | if(l==m) | ^~ anagrame.cpp:7:24: note: ‘l’ was declared here 7 | char s[21], r[21], l, m; | ^ anagrame.cpp:24:9: warning: ‘m’ may be used uninitialized [-Wmaybe-uninitialized] 24 | if(l==m) | ^~ anagrame.cpp:7:27: note: ‘m’ was declared here 7 | char s[21], r[21], l, m; | ^
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.001 secunde | OK. | 10 | 10 | Exemplu | |
| 2 | 0.001 secunde | OK. | 10 | 10 | ||
| 3 | 0.001 secunde | OK. | 20 | 20 | ||
| 4 | 0.001 secunde | Raspuns gresit. | 20 | 0 | ||
| 5 | 0.001 secunde | OK. | 20 | 20 | ||
| 6 | 0.001 secunde | OK. | 10 | 10 | ||
| 7 | 0.001 secunde | Raspuns gresit. | 10 | 0 | ||
| Punctaj total | 70 | |||||
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ă.