#90
NumarMaximVocale
Să se scrie un program care citește mai multe propoziții și determină propoziția cu cele mai multe vocale
Problema | NumarMaximVocale | Operații I/O |
vocmax.in /vocmax.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54079511 | Utilizator | |
Fișier | numarmaximvocale.cpp | Dimensiune | 558 B |
Data încărcării | 19 Noiembrie 2024, 12:04 | Scor / rezultat | Eroare de compilare |
numarmaximvocale.cpp:7:16: warning: character constant too long for its type [enabled by default] if (strchr('aeiou', S[i]); ^ numarmaximvocale.cpp:14:14: warning: character constant too long for its type [enabled by default] ifstream fin('vocmax.in'); ^ numarmaximvocale.cpp:15:15: warning: character constant too long for its type [enabled by default] ofstream fout('vocmax.out'); ^ numarmaximvocale.cpp: In function 'int numerare(char*)': numarmaximvocale.cpp:7:29: error: call of overloaded 'strchr(int, char&)' is ambiguous if (strchr('aeiou', S[i]); ^ numarmaximvocale.cpp:7:29: note: candidates are: In file included from /usr/include/c++/4.8/cstring:42:0, from numarmaximvocale.cpp:1: /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*' numarmaximvocale.cpp:7:30: error: expected ')' before ';' token if (strchr('aeiou', S[i]); ^ numarmaximvocale.cpp: In function 'int main()': numarmaximvocale.cpp:14:1: error: 'ifstream' was not declared in this scope ifstream fin('vocmax.in'); ^ numarmaximvocale.cpp:14:1: note: suggested alternative: In file included from /usr/include/c++/4.8/ios:38:0, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/fstream:38, from numarmaximvocale.cpp:2: /usr/include/c++/4.8/iosfwd:157:34: note: 'std::ifstream' typedef basic_ifstream<char> ifstream; ^ numarmaximvocale.cpp:14:10: error: expected ';' before 'fin' ifstream fin('vocmax.in'); ^ numarmaximvocale.cpp:15:1: error: 'ofstream' was not declared in this scope ofstream fout('vocmax.out'); ^ numarmaximvocale.cpp:15:1: note: suggested alternative: In file included from /usr/include/c++/4.8/ios:38:0, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/fstream:38, from numarmaximvocale.cpp:2: /usr/include/c++/4.8/iosfwd:160:34: note: 'std::ofstream' typedef basic_ofstream<char> ofstream; ^ numarmaximvocale.cpp:15:10: error: expected ';' before 'fout' ofstream fout('vocmax.out'); ^ numarmaximvocale.cpp:18:1: error: 'fin' was not declared in this scope fin >> n; ^ numarmaximvocale.cpp:26:5: error: 'fout' was not declared in this scope fout <<maxv; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema NumarMaximVocale 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ă.