#890
NrVocale
Se dă o propoziție formată din litere mari și mici ale alfabetului englez, cifre, spații și semne de punctuație, în care literele mari și mici se consideră identice. Determinați vocala din șir cu număr maxim de apariții.
Problema | NrVocale | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #47937887 | Utilizator | |
Fișier | nrvocale.cpp | Dimensiune | 929 B |
Data încărcării | 10 Ianuarie 2024, 17:47 | Scor / rezultat | Eroare de compilare |
nrvocale.cpp:10:26: warning: multi-character character constant [-Wmultichar] if(strchr(sir[i],'aA')){ ^ nrvocale.cpp:12:19: warning: multi-character character constant [-Wmultichar] if(strchr('eE',sir[i])){ ^ nrvocale.cpp:14:19: warning: multi-character character constant [-Wmultichar] if(strchr('iI',sir[i])){ ^ nrvocale.cpp:16:19: warning: multi-character character constant [-Wmultichar] if(strchr('oO',sir[i])){ ^ nrvocale.cpp:18:19: warning: multi-character character constant [-Wmultichar] if(strchr('uU',sir[i])){ ^ nrvocale.cpp: In function 'int main()': nrvocale.cpp:9:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int i=0; i<strlen(sir);i++){ ^ nrvocale.cpp:10:30: error: call of overloaded 'strchr(char&, int)' is ambiguous if(strchr(sir[i],'aA')){ ^ nrvocale.cpp:10:30: note: candidates are: In file included from /usr/include/c++/4.8/cstring:42:0, from nrvocale.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 'char' 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 'char' to 'const char*' nrvocale.cpp:12:30: error: call of overloaded 'strchr(int, char&)' is ambiguous if(strchr('eE',sir[i])){ ^ nrvocale.cpp:12:30: note: candidates are: In file included from /usr/include/c++/4.8/cstring:42:0, from nrvocale.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*' nrvocale.cpp:14:30: error: call of overloaded 'strchr(int, char&)' is ambiguous if(strchr('iI',sir[i])){ ^ nrvocale.cpp:14:30: note: candidates are: In file included from /usr/include/c++/4.8/cstring:42:0, from nrvocale.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*' nrvocale.cpp:16:30: error: call of overloaded 'strchr(int, char&)' is ambiguous if(strchr('oO',sir[i])){ ^ nrvocale.cpp:16:30: note: candidates are: In file included from /usr/include/c++/4.8/cstring:42:0, from nrvocale.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*' nrvocale.cpp:18:30: error: call of overloaded 'strchr(int, char&)' is ambiguous if(strchr('uU',sir[i])){ ^ nrvocale.cpp:18:30: note: candidates are: In file included from /usr/include/c++/4.8/cstring:42:0, from nrvocale.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*'
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema NrVocale 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ă.