#1875
platou1
Se consideră un șir de cifre. Să se determine lungimea maximală a unei secvențe din șir formată din cifre egale.
Problema | platou1 | Operații I/O |
platou1.in /platou1.out
|
---|---|---|---|
Limita timp | 0.01 secunde | Limita memorie |
Total: 0.5 MB
/
Stivă 0.5 MB
|
Id soluție | #38071948 | Utilizator | |
Fișier | platou1.cpp | Dimensiune | 642 B |
Data încărcării | 28 Septembrie 2022, 20:45 | Scor / rezultat | Eroare de compilare |
platou1.cpp:3:11: error: variable 'std::ifstream f' has initializer but incomplete type ifstream f("platou1.in"); ^ platou1.cpp:4:11: error: variable 'std::ofstream g' has initializer but incomplete type ofstream g("platou1.out"); ^ platou1.cpp:5:17: error: 'o' was not declared in this scope int x,y,k=0,max=o,a; ^ platou1.cpp: In function 'int main()': platou1.cpp:16:18: error: reference to 'max' is ambiguous if(k>max) ^ platou1.cpp:5:13: note: candidates are: int max int x,y,k=0,max=o,a; ^ In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from platou1.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:260:5: note: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare) max(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&) max(const _Tp& __a, const _Tp& __b) ^ platou1.cpp:18:17: error: reference to 'max' is ambiguous max=k; ^ platou1.cpp:5:13: note: candidates are: int max int x,y,k=0,max=o,a; ^ In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from platou1.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:260:5: note: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare) max(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&) max(const _Tp& __a, const _Tp& __b) ^ platou1.cpp:19:17: error: 'a' was not declared in this scope a=x; ^ platou1.cpp:22:23: error: reference to 'max' is ambiguous if(k==max) ^ platou1.cpp:5:13: note: candidates are: int max int x,y,k=0,max=o,a; ^ In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from platou1.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:260:5: note: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare) max(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&) max(const _Tp& __a, const _Tp& __b) ^ platou1.cpp:23:22: error: 'a' was not declared in this scope if(x<a) ^ platou1.cpp:29:10: error: reference to 'max' is ambiguous if(k>max) ^ platou1.cpp:5:13: note: candidates are: int max int x,y,k=0,max=o,a; ^ In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from platou1.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:260:5: note: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare) max(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&) max(const _Tp& __a, const _Tp& __b) ^ platou1.cpp:31:9: error: reference to 'max' is ambiguous max=k; ^ platou1.cpp:5:13: note: candidates are: int max int x,y,k=0,max=o,a; ^ In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from platou1.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:260:5: note: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare) max(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&) max(const _Tp& __a, const _Tp& __b) ^ platou1.cpp:32:9: error: 'a' was not declared in this scope a=x; ^ platou1.cpp:35:15: error: reference to 'max' is ambiguous if(k==max) ^ platou1.cpp:5:13: note: candidates are: int max int x,y,k=0,max=o,a; ^ In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from platou1.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:260:5: note: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare) max(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&) max(const _Tp& __a, const _Tp& __b) ^ platou1.cpp:36:14: error: 'a' was not declared in this scope if(x<a) ^ platou1.cpp:38:12: error: reference to 'max' is ambiguous g<<max<<" "<<a; ^ platou1.cpp:5:13: note: candidates are: int max int x,y,k=0,max=o,a; ^ In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from platou1.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:260:5: note: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare) max(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&) max(const _Tp& __a, const _Tp& __b) ^ platou1.cpp:38:22: error: 'a' was not declared in this scope g<<max<<" "<<a; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema platou1 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ă.