#97
Anagrame
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 | #1199658 | Utilizator | |
Fișier | anagrame.cpp | Dimensiune | 683 B |
Data încărcării | 16 Noiembrie 2015, 21:24 | Scor / rezultat | Eroare de compilare |
anagrame.cpp: In function 'int main()': anagrame.cpp:14:6: error: invalid conversion from 'char*' to 'int' [-fpermissive] i=a; ^ anagrame.cpp:16:17: warning: NULL used in arithmetic [-Wpointer-arith] while(b[i]!=NULL) ^ anagrame.cpp:24:18: warning: comparison with string literal results in unspecified behaviour [-Waddress] while(a!=" " || b!= " ") ^ anagrame.cpp:24:29: warning: comparison with string literal results in unspecified behaviour [-Waddress] while(a!=" " || b!= " ") ^ anagrame.cpp:26:36: error: invalid operands of types 'char [100]' and 'char*' to binary 'operator+' strcpy (b+strchr(b,a[0]) && b+strchr(b,a[0])+1) ^ anagrame.cpp:26:56: error: invalid operands of types 'char [100]' and 'char*' to binary 'operator+' strcpy (b+strchr(b,a[0]) && b+strchr(b,a[0])+1) ^ anagrame.cpp:27:13: error: expected ';' before 'strcpy' strcpy(a,a+1); ^ anagrame.cpp:28:15: warning: comparison with string literal results in unspecified behaviour [-Waddress] if(a==" " && b==" ") ^ anagrame.cpp:28:25: warning: comparison with string literal results in unspecified behaviour [-Waddress] if(a==" " && b==" ") ^ anagrame.cpp:6:33: warning: unused variable 'ok' [-Wunused-variable] char a[255],b[100]; int i=0,ok=1; ^
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ă.