#4735
MosCraciun6
Moș Crăciun locuiește la polul nord și pregătește cadouri pentru fetele și băieții cuminți din clasa a X-a A. Datorită încălzirii globale, gheața se topește, formându-se mai multe banchize. Harta polului nord seamănă cu o matrice cu n
linii și m
coloane în care elementele pot avea următoarele valori:
0
– zonă cu apă, în care gheața s-a topit;Scrieți un program care să determine care este suma valorilor cadourilor pentru fete sau pentru băieți aflate pe banchiza lui Moș Crăciun. Acesta se află pe banchiza care conține elementul aflat pe linia 1
și coloana 1
.
Problema | MosCraciun6 | Operații I/O |
moscraciun6.in /moscraciun6.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #55238266 | Utilizator | |
Fișier | moscraciun6.cpp | Dimensiune | 647 B |
Data încărcării | 08 Ianuarie 2025, 08:59 | Scor / rezultat | Eroare de compilare |
moscraciun6.cpp:5:21: error: expected ')' before '.' token ifstream(moscraciun6.in) ^ moscraciun6.cpp: In function 'void fill(int (*)[101], int, int, int)': moscraciun6.cpp:26:5: error: 'l' was not declared in this scope l--;fill()c++; ^ moscraciun6.cpp:26:14: error: no matching function for call to 'fill()' l--;fill()c++; ^ moscraciun6.cpp:26:14: note: candidates are: moscraciun6.cpp:24:6: note: void fill(int (*)[101], int, int, int) void fill(int a[][101], int n, int m, int p) ^ moscraciun6.cpp:24:6: note: candidate expects 4 arguments, 0 provided 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 moscraciun6.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:721:5: note: template<class _ForwardIterator, class _Tp> void std::fill(_ForwardIterator, _ForwardIterator, const _Tp&) fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) ^ /usr/include/c++/4.8/bits/stl_algobase.h:721:5: note: template argument deduction/substitution failed: moscraciun6.cpp:26:14: note: candidate expects 3 arguments, 0 provided l--;fill()c++; ^ moscraciun6.cpp:26:15: error: expected ';' before 'c' l--;fill()c++; ^ moscraciun6.cpp:27:14: error: no matching function for call to 'fill()' l++;fill()c--; ^ moscraciun6.cpp:27:14: note: candidates are: moscraciun6.cpp:24:6: note: void fill(int (*)[101], int, int, int) void fill(int a[][101], int n, int m, int p) ^ moscraciun6.cpp:24:6: note: candidate expects 4 arguments, 0 provided 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 moscraciun6.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:721:5: note: template<class _ForwardIterator, class _Tp> void std::fill(_ForwardIterator, _ForwardIterator, const _Tp&) fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) ^ /usr/include/c++/4.8/bits/stl_algobase.h:721:5: note: template argument deduction/substitution failed: moscraciun6.cpp:27:14: note: candidate expects 3 arguments, 0 provided l++;fill()c--; ^ moscraciun6.cpp:27:15: error: expected ';' before 'c' l++;fill()c--; ^ moscraciun6.cpp:28:14: error: no matching function for call to 'fill()' l--;fill()c--; ^ moscraciun6.cpp:28:14: note: candidates are: moscraciun6.cpp:24:6: note: void fill(int (*)[101], int, int, int) void fill(int a[][101], int n, int m, int p) ^ moscraciun6.cpp:24:6: note: candidate expects 4 arguments, 0 provided 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 moscraciun6.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:721:5: note: template<class _ForwardIterator, class _Tp> void std::fill(_ForwardIterator, _ForwardIterator, const _Tp&) fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) ^ /usr/include/c++/4.8/bits/stl_algobase.h:721:5: note: template argument deduction/substitution failed: moscraciun6.cpp:28:14: note: candidate expects 3 arguments, 0 provided l--;fill()c--; ^ moscraciun6.cpp:28:15: error: expected ';' before 'c' l--;fill()c--; ^ moscraciun6.cpp:29:14: error: no matching function for call to 'fill()' l++;fill()c++; ^ moscraciun6.cpp:29:14: note: candidates are: moscraciun6.cpp:24:6: note: void fill(int (*)[101], int, int, int) void fill(int a[][101], int n, int m, int p) ^ moscraciun6.cpp:24:6: note: candidate expects 4 arguments, 0 provided 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 moscraciun6.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:721:5: note: template<class _ForwardIterator, class _Tp> void std::fill(_ForwardIterator, _ForwardIterator, const _Tp&) fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) ^ /usr/include/c++/4.8/bits/stl_algobase.h:721:5: note: template argument deduction/substitution failed: moscraciun6.cpp:29:14: note: candidate expects 3 arguments, 0 provided l++;fill()c++; ^ moscraciun6.cpp:29:15: error: expected ';' before 'c' l++;fill()c++; ^ moscraciun6.cpp: In function 'int main()': moscraciun6.cpp:38:12: error: expected primary-expression before 'int' citire(int a, n, m); ^ moscraciun6.cpp:38:19: error: 'n' was not declared in this scope citire(int a, n, m); ^ moscraciun6.cpp:38:22: error: 'm' was not declared in this scope citire(int a, n, m); ^ moscraciun6.cpp:38:23: error: 'citire' was not declared in this scope citire(int a, n, m); ^ moscraciun6.cpp:40:5: error: 'fout' was not declared in this scope fout<<s<< " "; ^ moscraciun6.cpp:40:11: error: 's' was not declared in this scope fout<<s<< " "; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema MosCraciun6 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ă.