#972
Se dă un șir de caractere. Să se determine câte vocale din șir sunt cuprinse între două consoane.
Problema | Pozitii | Operații I/O |
![]() |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #56684756 | Utilizator | |
Fișier | pozitii.cpp | Dimensiune | 332 B |
Data încărcării | 02 Martie 2025, 18:43 | Scor / rezultat | Eroare de compilare |
pozitii.cpp:10:16: warning: character constant too long for its type [enabled by default] if(strchr('aeiou',s[i-1])==NULL&&strchr('aeiou',s[i+1])==NULL&&strchr('aeiou',s[i])!=NULL&& s[i-1]!=' ' && s[i+1] != ' ' && s[i] != ' ') ^ pozitii.cpp:10:46: warning: character constant too long for its type [enabled by default] if(strchr('aeiou',s[i-1])==NULL&&strchr('aeiou',s[i+1])==NULL&&strchr('aeiou',s[i])!=NULL&& s[i-1]!=' ' && s[i+1] != ' ' && s[i] != ' ') ^ pozitii.cpp:10:76: warning: character constant too long for its type [enabled by default] if(strchr('aeiou',s[i-1])==NULL&&strchr('aeiou',s[i+1])==NULL&&strchr('aeiou',s[i])!=NULL&& s[i-1]!=' ' && s[i+1] != ' ' && s[i] != ' ') ^ pozitii.cpp: In function 'int main()': pozitii.cpp:9:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int i=1;i<=strlen(s);i++) ^ pozitii.cpp:10:30: error: call of overloaded 'strchr(int, char&)' is ambiguous if(strchr('aeiou',s[i-1])==NULL&&strchr('aeiou',s[i+1])==NULL&&strchr('aeiou',s[i])!=NULL&& s[i-1]!=' ' && s[i+1] != ' ' && s[i] != ' ') ^ pozitii.cpp:10:30: note: candidates are: In file included from pozitii.cpp:2:0: /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*' pozitii.cpp:10:60: error: call of overloaded 'strchr(int, char&)' is ambiguous if(strchr('aeiou',s[i-1])==NULL&&strchr('aeiou',s[i+1])==NULL&&strchr('aeiou',s[i])!=NULL&& s[i-1]!=' ' && s[i+1] != ' ' && s[i] != ' ') ^ pozitii.cpp:10:60: note: candidates are: In file included from pozitii.cpp:2:0: /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*' pozitii.cpp:10:88: error: call of overloaded 'strchr(int, char&)' is ambiguous if(strchr('aeiou',s[i-1])==NULL&&strchr('aeiou',s[i+1])==NULL&&strchr('aeiou',s[i])!=NULL&& s[i-1]!=' ' && s[i+1] != ' ' && s[i] != ' ') ^ pozitii.cpp:10:88: note: candidates are: In file included from pozitii.cpp:2:0: /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*'
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Pozitii 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ă.