#4183
bac_eroziune
Scrieți un program C/C++ care citește de la tastatură două numere naturale L
și C
, apoi elementele unui tablou bidimensional cu L
linii şi C
coloane reprezentând nivelurile parcelelor, în ordinea dispunerii acestora pe plajă și determină cantitatea totală de nisip adăugată, măsurată în metri cubi.
Bacalaureat 2022, sesiunea iunie
Problema | bac_eroziune | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54047185 | Utilizator | |
Fișier | bac_eroziune.cpp | Dimensiune | 672 B |
Data încărcării | 18 Noiembrie 2024, 17:49 | Scor / rezultat | Eroare de compilare |
bac_eroziune.cpp: In function 'int main()': bac_eroziune.cpp:10:9: error: 'i' was not declared in this scope for(i=0;i<=L+1,i++){ ^ bac_eroziune.cpp:10:23: error: expected ';' before ')' token for(i=0;i<=L+1,i++){ ^ bac_eroziune.cpp:20:13: error: reference to 'min' is ambiguous min=a[i-1][j]; ^ bac_eroziune.cpp:3:25: note: candidates are: int min int L,C,I,j,a[110][110],min,s; ^ 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 bac_eroziune.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:239:5: note: template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare) min(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algobase.h:193:5: note: template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&) min(const _Tp& __a, const _Tp& __b) ^ bac_eroziune.cpp:21:16: error: reference to 'min' is ambiguous if(min>a[i][j+1]) min=a[i][j+1]; ^ bac_eroziune.cpp:3:25: note: candidates are: int min int L,C,I,j,a[110][110],min,s; ^ 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 bac_eroziune.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:239:5: note: template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare) min(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algobase.h:193:5: note: template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&) min(const _Tp& __a, const _Tp& __b) ^ bac_eroziune.cpp:21:31: error: reference to 'min' is ambiguous if(min>a[i][j+1]) min=a[i][j+1]; ^ bac_eroziune.cpp:3:25: note: candidates are: int min int L,C,I,j,a[110][110],min,s; ^ 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 bac_eroziune.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:239:5: note: template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare) min(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algobase.h:193:5: note: template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&) min(const _Tp& __a, const _Tp& __b) ^ bac_eroziune.cpp:22:16: error: reference to 'min' is ambiguous if(min>a[i+1][j]) min=a[i+1][j]; ^ bac_eroziune.cpp:3:25: note: candidates are: int min int L,C,I,j,a[110][110],min,s; ^ 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 bac_eroziune.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:239:5: note: template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare) min(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algobase.h:193:5: note: template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&) min(const _Tp& __a, const _Tp& __b) ^ bac_eroziune.cpp:22:31: error: reference to 'min' is ambiguous if(min>a[i+1][j]) min=a[i+1][j]; ^ bac_eroziune.cpp:3:25: note: candidates are: int min int L,C,I,j,a[110][110],min,s; ^ 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 bac_eroziune.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:239:5: note: template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare) min(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algobase.h:193:5: note: template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&) min(const _Tp& __a, const _Tp& __b) ^ bac_eroziune.cpp:23:16: error: reference to 'min' is ambiguous if(min>a[i][j-1]) min=a[i][j-1]; ^ bac_eroziune.cpp:3:25: note: candidates are: int min int L,C,I,j,a[110][110],min,s; ^ 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 bac_eroziune.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:239:5: note: template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare) min(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algobase.h:193:5: note: template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&) min(const _Tp& __a, const _Tp& __b) ^ bac_eroziune.cpp:23:31: error: reference to 'min' is ambiguous if(min>a[i][j-1]) min=a[i][j-1]; ^ bac_eroziune.cpp:3:25: note: candidates are: int min int L,C,I,j,a[110][110],min,s; ^ 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 bac_eroziune.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:239:5: note: template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare) min(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algobase.h:193:5: note: template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&) min(const _Tp& __a, const _Tp& __b) ^ bac_eroziune.cpp:24:16: error: reference to 'min' is ambiguous if(min>a[i][j]) s=s+min-a[i][j]; ^ bac_eroziune.cpp:3:25: note: candidates are: int min int L,C,I,j,a[110][110],min,s; ^ 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 bac_eroziune.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:239:5: note: template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare) min(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algobase.h:193:5: note: template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&) min(const _Tp& __a, const _Tp& __b) ^ bac_eroziune.cpp:24:33: error: reference to 'min' is ambiguous if(min>a[i][j]) s=s+min-a[i][j]; ^ bac_eroziune.cpp:3:25: note: candidates are: int min int L,C,I,j,a[110][110],min,s; ^ 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 bac_eroziune.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:239:5: note: template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare) min(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algobase.h:193:5: note: template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&) min(const _Tp& __a, const _Tp& __b) ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema bac_eroziune 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ă.