#90
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 | #64927526 | Utilizator | |
| Fișier | numarmaximvocale.cpp | Dimensiune | 559 B |
| Data încărcării | 15 Iunie 2026, 11:10 | Scor/rezultat | Eroare de compilare |
numarmaximvocale.cpp: In function ‘int main()’: numarmaximvocale.cpp:17:25: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare] 17 | for(int i = 0; i<strlen(s); i++) | ~^~~~~~~~~~ numarmaximvocale.cpp:19:16: warning: init-statement in selection statements only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions] 19 | if(strchr("aeiou", s[i]) voc++; | ^~~~~~ numarmaximvocale.cpp:19:37: error: expected ‘;’ before ‘voc’ 19 | if(strchr("aeiou", s[i]) voc++; | ^~~~ | ; numarmaximvocale.cpp:19:22: warning: statement has no effect [-Wunused-value] 19 | if(strchr("aeiou", s[i]) voc++; | ~~~~~~^~~~~~~~~~~~~~~ numarmaximvocale.cpp:20:9: error: expected primary-expression before ‘}’ token 20 | } | ^ numarmaximvocale.cpp:19:44: error: expected ‘)’ before ‘}’ token 19 | if(strchr("aeiou", s[i]) voc++; | ~ ^ | ) 20 | } | ~ numarmaximvocale.cpp:20:9: error: expected primary-expression before ‘}’ token 20 | } | ^ numarmaximvocale.cpp:21:19: error: reference to ‘max’ is ambiguous 21 | if(max < voc){ | ^~~ In file included from /usr/include/c++/13/string:51, from /usr/include/c++/13/bits/locale_classes.h:40, from /usr/include/c++/13/bits/ios_base.h:41, from /usr/include/c++/13/ios:44, from /usr/include/c++/13/istream:40, from /usr/include/c++/13/fstream:40, from numarmaximvocale.cpp:1: /usr/include/c++/13/bits/stl_algobase.h:303:5: note: candidates are: ‘template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)’ 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/13/bits/stl_algobase.h:257:5: note: ‘template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)’ 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ numarmaximvocale.cpp:5:13: note: ‘int max’ 5 | int n, voc, max; | ^~~ numarmaximvocale.cpp:22:20: error: reference to ‘max’ is ambiguous 22 | max = voc; | ^~~ /usr/include/c++/13/bits/stl_algobase.h:303:5: note: candidates are: ‘template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)’ 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/13/bits/stl_algobase.h:257:5: note: ‘template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)’ 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ numarmaximvocale.cpp:5:13: note: ‘int max’ 5 | int n, voc, max; | ^~~
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ă.