#890
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 | #64544771 | Utilizator | |
| Fișier | nrvocale.cpp | Dimensiune | 893 B |
| Data încărcării | 13 Mai 2026, 13:35 | Scor/rezultat | Eroare de compilare |
nrvocale.cpp: In function ‘int main()’: nrvocale.cpp:18:9: error: ‘i’ was not declared in this scope 18 | for(i=0;i<strlen(s);i++) | ^ nrvocale.cpp:25:15: error: no matching function for call to ‘max(int&, int&, int&, int&, int&)’ 25 | if(max(v['a'],v['e'],v['i'],v['o'],v['u'])==v['a']) | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/13/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:51, from nrvocale.cpp:1: /usr/include/c++/13/bits/stl_algobase.h:257:5: note: candidate: ‘template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)’ 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/13/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: nrvocale.cpp:25:15: note: candidate expects 2 arguments, 5 provided 25 | if(max(v['a'],v['e'],v['i'],v['o'],v['u'])==v['a']) | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/13/bits/stl_algobase.h:303:5: note: candidate: ‘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:303:5: note: template argument deduction/substitution failed: nrvocale.cpp:25:15: note: candidate expects 3 arguments, 5 provided 25 | if(max(v['a'],v['e'],v['i'],v['o'],v['u'])==v['a']) | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/13/algorithm:61: /usr/include/c++/13/bits/stl_algo.h:5795:5: note: candidate: ‘template<class _Tp> _Tp std::max(initializer_list<_Tp>)’ 5795 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/13/bits/stl_algo.h:5795:5: note: template argument deduction/substitution failed: nrvocale.cpp:25:15: note: mismatched types ‘std::initializer_list<_Tp>’ and ‘int’ 25 | if(max(v['a'],v['e'],v['i'],v['o'],v['u'])==v['a']) | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/13/bits/stl_algo.h:5805:5: note: candidate: ‘template<class _Tp, class _Compare> _Tp std::max(initializer_list<_Tp>, _Compare)’ 5805 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/13/bits/stl_algo.h:5805:5: note: template argument deduction/substitution failed: nrvocale.cpp:25:15: note: mismatched types ‘std::initializer_list<_Tp>’ and ‘int’ 25 | if(max(v['a'],v['e'],v['i'],v['o'],v['u'])==v['a']) | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nrvocale.cpp:28:12: error: no matching function for call to ‘max(int&, int&, int&, int&, int&)’ 28 | }if(max(v['a'],v['e'],v['i'],v['o'],v['u'])==v['e']) | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/13/bits/stl_algobase.h:257:5: note: candidate: ‘template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)’ 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/13/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: nrvocale.cpp:28:12: note: candidate expects 2 arguments, 5 provided 28 | }if(max(v['a'],v['e'],v['i'],v['o'],v['u'])==v['e']) | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/13/bits/stl_algobase.h:303:5: note: candidate: ‘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:303:5: note: template argument deduction/substitution failed: nrvocale.cpp:28:12: note: candidate expects 3 arguments, 5 provided 28 | }if(max(v['a'],v['e'],v['i'],v['o'],v['u'])==v['e']) | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/13/bits/stl_algo.h:5795:5: note: candidate: ‘template<class _Tp> _Tp std::max(initializer_list<_Tp>)’ 5795 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/13/bits/stl_algo.h:5795:5: note: template argument deduction/substitution failed: nrvocale.cpp:28:12: note: mismatched types ‘std::initializer_list<_Tp>’ and ‘int’ 28 | }if(max(v['a'],v['e'],v['i'],v['o'],v['u'])==v['e']) | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/13/bits/stl_algo.h:5805:5: note: candidate: ‘template<class _Tp, class _Compare> _Tp std::max(initializer_list<_Tp>, _Compare)’ 5805 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/13/bits/stl_algo.h:5805:5: note: template argument deduction/substitution failed: nrvocale.cpp:28:12: note: mismatched types ‘std::initializer_list<_Tp>’ and ‘int’ 28 | }if(max(v['a'],v['e'],v['i'],v['o'],v['u'])==v['e']) | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nrvocale.cpp:31:12: error: no matching function for call to ‘max(int&, int&, int&, int&, int&)’ 31 | }if(max(v['a'],v['e'],v['i'],v['o'],v['u'])==v['i']) | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/13/bits/stl_algobase.h:257:5: note: candidate: ‘template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)’ 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/13/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: nrvocale.cpp:31:12: note: candidate expects 2 arguments, 5 provided 31 | }if(max(v['a'],v['e'],v['i'],v['o'],v['u'])==v['i']) | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/13/bits/stl_algobase.h:303:5: note: candidate: ‘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:303:5: note: template argument deduction/substitution failed: nrvocale.cpp:31:12: note: candidate expects 3 arguments, 5 provided 31 | }if(max(v['a'],v['e'],v['i'],v['o'],v['u'])==v['i']) | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/13/bits/stl_algo.h:5795:5: note: candidate: ‘template<class _Tp> _Tp std::max(initializer_list<_Tp>)’ 5795 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/13/bits/stl_algo.h:5795:5: note: template argument deduction/substitution failed: nrvocale.cpp:31:12: note: mismatched types ‘std::initializer_list<_Tp>’ and ‘int’ 31 | }if(max(v['a'],v['e'],v['i'],v['o'],v['u'])==v['i']) | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/13/bits/stl_algo.h:5805:5: note: candidate: ‘template<class _Tp, class _Compare> _Tp std::max(initializer_list<_Tp>, _Compare)’ 5805 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/13/bits/stl_algo.h:5805:5: note: template argument deduction/substitution failed: nrvocale.cpp:31:12: note: mismatched types ‘std::initializer_list<_Tp>’ and ‘int’ 31 | }if(max(v['a'],v['e'],v['i'],v['o'],v['u'])==v['i']) | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nrvocale.cpp:34:12: error: no matching function for call to ‘max(int&, int&, int&, int&, int&)’ 34 | }if(max(v['a'],v['e'],v['i'],v['o'],v['u'])==v['o']) | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/13/bits/stl_algobase.h:257:5: note: candidate: ‘template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)’ 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/13/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: nrvocale.cpp:34:12: note: candidate expects 2 arguments, 5 provided 34 | }if(max(v['a'],v['e'],v['i'],v['o'],v['u'])==v['o']) | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/13/bits/stl_algobase.h:303:5: note: candidate: ‘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:303:5: note: template argument deduction/substitution failed: nrvocale.cpp:34:12: note: candidate expects 3 arguments, 5 provided 34 | }if(max(v['a'],v['e'],v['i'],v['o'],v['u'])==v['o']) | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/13/bits/stl_algo.h:5795:5: note: candidate: ‘template<class _Tp> _Tp std::max(initializer_list<_Tp>)’ 5795 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/13/bits/stl_algo.h:5795:5: note: template argument deduction/substitution failed: nrvocale.cpp:34:12: note: mismatched types ‘std::initializer_list<_Tp>’ and ‘int’ 34 | }if(max(v['a'],v['e'],v['i'],v['o'],v['u'])==v['o']) | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/13/bits/stl_algo.h:5805:5: note: candidate: ‘template<class _Tp, class _Compare> _Tp std::max(initializer_list<_Tp>, _Compare)’ 5805 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/13/bits/stl_algo.h:5805:5: note: template argument deduction/substitution failed: nrvocale.cpp:34:12: note: mismatched types ‘std::initializer_list<_Tp>’ and ‘int’ 34 | }if(max(v['a'],v['e'],v['i'],v['o'],v['u'])==v['o']) | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nrvocale.cpp:37:12: error: no matching function for call to ‘max(int&, int&, int&, int&, int&)’ 37 | }if(max(v['a'],v['e'],v['i'],v['o'],v['u'])==v['u']) | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/13/bits/stl_algobase.h:257:5: note: candidate: ‘template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)’ 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/13/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: nrvocale.cpp:37:12: note: candidate expects 2 arguments, 5 provided 37 | }if(max(v['a'],v['e'],v['i'],v['o'],v['u'])==v['u']) | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/13/bits/stl_algobase.h:303:5: note: candidate: ‘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:303:5: note: template argument deduction/substitution failed: nrvocale.cpp:37:12: note: candidate expects 3 arguments, 5 provided 37 | }if(max(v['a'],v['e'],v['i'],v['o'],v['u'])==v['u']) | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/13/bits/stl_algo.h:5795:5: note: candidate: ‘template<class _Tp> _Tp std::max(initializer_list<_Tp>)’ 5795 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/13/bits/stl_algo.h:5795:5: note: template argument deduction/substitution failed: nrvocale.cpp:37:12: note: mismatched types ‘std::initializer_list<_Tp>’ and ‘int’ 37 | }if(max(v['a'],v['e'],v['i'],v['o'],v['u'])==v['u']) | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/13/bits/stl_algo.h:5805:5: note: candidate: ‘template<class _Tp, class _Compare> _Tp std::max(initializer_list<_Tp>, _Compare)’ 5805 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/13/bits/stl_algo.h:5805:5: note: template argument deduction/substitution failed: nrvocale.cpp:37:12: note: mismatched types ‘std::initializer_list<_Tp>’ and ‘int’ 37 | }if(max(v['a'],v['e'],v['i'],v['o'],v['u'])==v['u']) | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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ă.