#1650
AcelasiNumar
C++
Se dă un număr întreg n
și alte k
numere întregi. Să se afle dacă, adunând toate cele k
numere la n
se obține o valoare egală cu valoarea inițială a lui n
.
Problema | AcelasiNumar | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54198940 | Utilizator | |
Fișier | acelasinumar.cpp | Dimensiune | 277 B |
Data încărcării | 21 Noiembrie 2024, 21:39 | Scor / rezultat | Eroare de compilare |
acelasinumar.cpp: In function 'int main()': acelasinumar.cpp:6:5: error: reference to 'copy' is ambiguous copy = n; ^ acelasinumar.cpp:3:14: note: candidates are: int copy int n, k, t, copy, i; ^ In file included from /usr/include/c++/4.8/bits/locale_facets.h:48:0, from /usr/include/c++/4.8/bits/basic_ios.h:37, from /usr/include/c++/4.8/ios:44, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from acelasinumar.cpp:1: /usr/include/c++/4.8/bits/streambuf_iterator.h:293:5: note: template<class _CharT> typename __gnu_cxx::__enable_if<std::__is_char<_Tp>::__value, std::ostreambuf_iterator<_CharT> >::__type std::copy(std::istreambuf_iterator<_CharT>, std::istreambuf_iterator<_CharT>, std::ostreambuf_iterator<_CharT>) copy(istreambuf_iterator<_CharT> __first, ^ 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 acelasinumar.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:450:5: note: template<class _II, class _OI> _OI std::copy(_II, _II, _OI) copy(_II __first, _II __last, _OI __result) ^ acelasinumar.cpp:11:16: error: reference to 'copy' is ambiguous } if (n == copy) cout << "DA"; ^ acelasinumar.cpp:3:14: note: candidates are: int copy int n, k, t, copy, i; ^ In file included from /usr/include/c++/4.8/bits/locale_facets.h:48:0, from /usr/include/c++/4.8/bits/basic_ios.h:37, from /usr/include/c++/4.8/ios:44, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from acelasinumar.cpp:1: /usr/include/c++/4.8/bits/streambuf_iterator.h:293:5: note: template<class _CharT> typename __gnu_cxx::__enable_if<std::__is_char<_Tp>::__value, std::ostreambuf_iterator<_CharT> >::__type std::copy(std::istreambuf_iterator<_CharT>, std::istreambuf_iterator<_CharT>, std::ostreambuf_iterator<_CharT>) copy(istreambuf_iterator<_CharT> __first, ^ 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 acelasinumar.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:450:5: note: template<class _II, class _OI> _OI std::copy(_II, _II, _OI) copy(_II __first, _II __last, _OI __result) ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema AcelasiNumar 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ă.