#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 | #54347598 | Utilizator | |
Fișier | anagrame.cpp | Dimensiune | 643 B |
Data încărcării | 26 Noiembrie 2024, 11:44 | Scor / rezultat | Eroare de compilare |
anagrame.cpp:9:11: error: expected '}' before ';' token cin>>s; ^ anagrame.cpp:9:8: error: invalid user-defined conversion from 'std::basic_istream<char>' to 'int' [-fpermissive] cin>>s; ^ In file included from /usr/include/c++/4.8/ios:44:0, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from anagrame.cpp:1: /usr/include/c++/4.8/bits/basic_ios.h:115:7: note: candidate is: std::basic_ios<_CharT, _Traits>::operator void*() const [with _CharT = char; _Traits = std::char_traits<char>] <near match> operator void*() const ^ /usr/include/c++/4.8/bits/basic_ios.h:115:7: note: no known conversion for implicit 'this' parameter from 'void*' to 'int' anagrame.cpp:10:5: error: 'l' does not name a type l=strlen(s); ^ anagrame.cpp:11:5: error: expected unqualified-id before 'for' for(i=0;i<=l-1;i++) ^ anagrame.cpp:11:13: error: 'i' does not name a type for(i=0;i<=l-1;i++) ^ anagrame.cpp:11:20: error: 'i' does not name a type for(i=0;i<=l-1;i++) ^ anagrame.cpp:12:19: error: 'j' does not name a type for(j=i+1;j<=l-1;j++) ^ anagrame.cpp:12:26: error: 'j' does not name a type for(j=i+1;j<=l-1;j++) ^ anagrame.cpp:19:5: error: 'cin' does not name a type cin>>t; ^ anagrame.cpp:21:5: error: 'l' does not name a type l=strlen(t); ^ anagrame.cpp:22:5: error: expected unqualified-id before 'for' for(i=0;i<=l-1;i++) ^ anagrame.cpp:22:13: error: 'i' does not name a type for(i=0;i<=l-1;i++) ^ anagrame.cpp:22:20: error: 'i' does not name a type for(i=0;i<=l-1;i++) ^ anagrame.cpp:23:19: error: 'j' does not name a type for(j=i+1;j<=l-1;j++) ^ anagrame.cpp:23:26: error: 'j' does not name a type for(j=i+1;j<=l-1;j++) ^ anagrame.cpp:30:9: error: expected unqualified-id before 'if' if(strcmp(s,t)==0) ^ anagrame.cpp:32:9: error: expected unqualified-id before 'else' else ^ anagrame.cpp:35:5: error: expected unqualified-id before 'return' return 0; ^ anagrame.cpp:36:1: error: expected declaration before '}' token } ^
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ă.