#275
PerechiVocale1
Se dă un text în care cuvintele sunt formate din litere mici ale alfabetului englez şi cifre şi sunt separate prin spaţii şi semne de punctuaţie. Să se determine perechea de vocale alăturate din text care apare de cele mai multe ori.
Variante Bacalaureat 2009
Problema | PerechiVocale1 | Operații I/O |
perechivocale1.in /perechivocale1.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #50583876 | Utilizator | |
Fișier | perechivocale1.cpp | Dimensiune | 737 B |
Data încărcării | 16 Aprilie 2024, 08:39 | Scor / rezultat | Eroare de compilare |
perechivocale1.cpp:5:18: error: invalid conversion from 'const char*' to 'char' [-fpermissive] char s[513], voc="aeiou"; ^ perechivocale1.cpp: In function 'int main()': perechivocale1.cpp:9:12: error: 'fin' was not declared in this scope while (fin.getline (s, 513)) ^ perechivocale1.cpp:11:31: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (k=0; k< strlen (s); k++) ^ perechivocale1.cpp:12:34: error: call of overloaded 'strchr(char&, char&)' is ambiguous if (strchr (voc, s[k]) && strchr (voc, s[k+1])) ^ perechivocale1.cpp:12:34: note: candidates are: In file included from /usr/include/c++/4.8/cstring:42:0, from perechivocale1.cpp:3: /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*' perechivocale1.cpp:12:58: error: call of overloaded 'strchr(char&, char&)' is ambiguous if (strchr (voc, s[k]) && strchr (voc, s[k+1])) ^ perechivocale1.cpp:12:58: note: candidates are: In file included from /usr/include/c++/4.8/cstring:42:0, from perechivocale1.cpp:3: /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*' perechivocale1.cpp:14:33: error: call of overloaded 'strchr(char&, char&)' is ambiguous i= strchr (voc, s[k])- voc; ^ perechivocale1.cpp:14:33: note: candidates are: In file included from /usr/include/c++/4.8/cstring:42:0, from perechivocale1.cpp:3: /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*' perechivocale1.cpp:15:35: error: call of overloaded 'strchr(char&, char&)' is ambiguous j= strchr (voc, s[k+1])- voc; ^ perechivocale1.cpp:15:35: note: candidates are: In file included from /usr/include/c++/4.8/cstring:42:0, from perechivocale1.cpp:3: /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*' perechivocale1.cpp:27:9: error: 'fout' was not declared in this scope fout<<voc[i]<<voc[j]; ^ perechivocale1.cpp:27:20: error: invalid types 'char[int]' for array subscript fout<<voc[i]<<voc[j]; ^ perechivocale1.cpp:27:28: error: invalid types 'char[int]' for array subscript fout<<voc[i]<<voc[j]; ^ perechivocale1.cpp:28:9: error: 'ok' was not declared in this scope ok++; ^ perechivocale1.cpp:30:10: error: 'ok' was not declared in this scope if (!ok) ^ perechivocale1.cpp:31:9: error: 'fout' was not declared in this scope fout<<"NU"; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema PerechiVocale1 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ă.