#972
Pozitii
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 | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54571262 | Utilizator | |
Fișier | pozitii.cpp | Dimensiune | 689 B |
Data încărcării | 02 Decembrie 2024, 19:22 | Scor / rezultat | Eroare de compilare |
pozitii.cpp: In function 'int main()': pozitii.cpp:14:24: warning: NULL used in arithmetic [-Wpointer-arith] for(int i=0; s[i]!=NULL; i++) ^ pozitii.cpp:18:41: error: call of overloaded 'strchr(char&, const char [11])' is ambiguous if(strchr(s[i], "AEIOUaeiou")!=NULL) ^ pozitii.cpp:18:41: note: candidates are: In file included from /usr/include/c++/4.8/cstring:42:0, from pozitii.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 2 from 'const char [11]' to 'int' /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 2 from 'const char [11]' to 'int' pozitii.cpp:20:78: error: call of overloaded 'strchr(char&, const char [42])' is ambiguous if(strchr(s[i-1], "BCDFGHJKLMNPQRSTVWXYZbcdfgjklmnpqrstvwxyz")!=NULL and strchr(s[i+1], "BCDFGHJKLMNPQRSTVWXYZbcdfgjklmnpqrstvwxyz")!=NULL) ^ pozitii.cpp:20:78: note: candidates are: In file included from /usr/include/c++/4.8/cstring:42:0, from pozitii.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 2 from 'const char [42]' to 'int' /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 2 from 'const char [42]' to 'int' pozitii.cpp:20:148: error: call of overloaded 'strchr(char&, const char [42])' is ambiguous if(strchr(s[i-1], "BCDFGHJKLMNPQRSTVWXYZbcdfgjklmnpqrstvwxyz")!=NULL and strchr(s[i+1], "BCDFGHJKLMNPQRSTVWXYZbcdfgjklmnpqrstvwxyz")!=NULL) ^ pozitii.cpp:20:148: note: candidates are: In file included from /usr/include/c++/4.8/cstring:42:0, from pozitii.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 2 from 'const char [42]' to 'int' /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 2 from 'const char [42]' to 'int'
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ă.