#3913
Se citește un cuvânt S
format din litere mici distincte ale alfabetului englez și un număr m
. Afișați în ordine lexicografică toate cuvintele formate din cel puțin m
litere ordonate alfabetic din S
, în care nu există vocale alăturate și se termină cu consoană.
Problema | Cuvinte11 | Operații I/O |
![]() |
---|---|---|---|
Limita timp | 0.3 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #56767832 | Utilizator | |
Fișier | cuvinte11.cpp | Dimensiune | 928 B |
Data încărcării | 05 Martie 2025, 10:54 | Scor / rezultat | Eroare de compilare |
cuvinte11.cpp:11:20: warning: character constant too long for its type [enabled by default] if(k>1&&strchr('aeiou',S[x[k]])*strchr('aeiou',S[x[k-1]])!=0) ^ cuvinte11.cpp:11:44: warning: character constant too long for its type [enabled by default] if(k>1&&strchr('aeiou',S[x[k]])*strchr('aeiou',S[x[k-1]])!=0) ^ cuvinte11.cpp:17:21: warning: character constant too long for its type [enabled by default] if(k>=m&&strchr('aeiou',S[x[k]])==0) ^ cuvinte11.cpp: In function 'int valid(int)': cuvinte11.cpp:11:35: error: call of overloaded 'strchr(int, char&)' is ambiguous if(k>1&&strchr('aeiou',S[x[k]])*strchr('aeiou',S[x[k-1]])!=0) ^ cuvinte11.cpp:11:35: note: candidates are: In file included from /usr/include/c++/4.8/cstring:42:0, from cuvinte11.cpp:2: /usr/include/string.h:223:1: note: char* strchr(char*, int) <near match> strchr (char *__s, int __c) __THROW ^ /usr/include/string.h:223:1: note: no known conversion for argument 1 from 'int' to 'char*' /usr/include/string.h:229:1: note: const char* strchr(const char*, int) <near match> strchr (const char *__s, int __c) __THROW ^ /usr/include/string.h:229:1: note: no known conversion for argument 1 from 'int' to 'const char*' cuvinte11.cpp:11:61: error: call of overloaded 'strchr(int, char&)' is ambiguous if(k>1&&strchr('aeiou',S[x[k]])*strchr('aeiou',S[x[k-1]])!=0) ^ cuvinte11.cpp:11:61: note: candidates are: In file included from /usr/include/c++/4.8/cstring:42:0, from cuvinte11.cpp:2: /usr/include/string.h:223:1: note: char* strchr(char*, int) <near match> strchr (char *__s, int __c) __THROW ^ /usr/include/string.h:223:1: note: no known conversion for argument 1 from 'int' to 'char*' /usr/include/string.h:229:1: note: const char* strchr(const char*, int) <near match> strchr (const char *__s, int __c) __THROW ^ /usr/include/string.h:229:1: note: no known conversion for argument 1 from 'int' to 'const char*' cuvinte11.cpp:8:9: warning: unused variable 'i' [-Wunused-variable] int i; ^ cuvinte11.cpp: In function 'int solutie(int)': cuvinte11.cpp:17:36: error: call of overloaded 'strchr(int, char&)' is ambiguous if(k>=m&&strchr('aeiou',S[x[k]])==0) ^ cuvinte11.cpp:17:36: note: candidates are: In file included from /usr/include/c++/4.8/cstring:42:0, from cuvinte11.cpp:2: /usr/include/string.h:223:1: note: char* strchr(char*, int) <near match> strchr (char *__s, int __c) __THROW ^ /usr/include/string.h:223:1: note: no known conversion for argument 1 from 'int' to 'char*' /usr/include/string.h:229:1: note: const char* strchr(const char*, int) <near match> strchr (const char *__s, int __c) __THROW ^ /usr/include/string.h:229:1: note: no known conversion for argument 1 from 'int' to 'const char*' cuvinte11.cpp:21:1: warning: control reaches end of non-void function [-Wreturn-type] } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Cuvinte11 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ă.