#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 | #64798975 | Utilizator | |
| Fișier | anagrame.cpp | Dimensiune | 279 B |
| Data încărcării | 02 Iunie 2026, 09:38 | Scor/rezultat | Eroare de compilare |
anagrame.cpp: In function ‘int main()’: anagrame.cpp:11:24: error: expected ‘)’ before ‘s’ 11 | if (strchr ("aeiou" s[i]) && strchr("aeiou" ,s[i-1]) ) | ~ ^ ~ | ) anagrame.cpp:11:16: error: no matching function for call to ‘strchr(const char [6])’ 11 | if (strchr ("aeiou" s[i]) && strchr("aeiou" ,s[i-1]) ) | ~~~~~~~^~~~~~~~~~~ In file included from /usr/include/c++/13/cstring:42, from anagrame.cpp:2: /usr/include/string.h:233:1: note: candidate: ‘char* strchr(char*, int)’ 233 | strchr (char *__s, int __c) __THROW | ^~~~~~ /usr/include/string.h:233:1: note: candidate expects 2 arguments, 1 provided /usr/include/string.h:239:1: note: candidate: ‘const char* strchr(const char*, int)’ 239 | strchr (const char *__s, int __c) __THROW | ^~~~~~ /usr/include/string.h:239:1: note: candidate expects 2 arguments, 1 provided anagrame.cpp:12:12: error: expected ‘;’ before ‘:’ token 12 | p++: | ^ | ;
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ă.