| Problema | Numere Mari | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #63274136 | Utilizator | |
| Fișier | numere_mari.cpp | Dimensiune | 4.72 KB |
| Data încărcării | 24 Februarie 2026, 13:54 | Scor/rezultat | Eroare de compilare |
numere_mari.cpp:5:1: error: 'big_int' does not name a type big_int::big_int() { ^ numere_mari.cpp:10:1: error: 'big_int' does not name a type big_int::big_int(string s) { ^ numere_mari.cpp:23:1: error: 'big_int' does not name a type big_int::big_int(int n) { ^ numere_mari.cpp:36:1: error: 'big_int' does not name a type big_int::operator string() const { ^ numere_mari.cpp:43:1: error: 'friend' used outside of class friend bool operator == (const big_int& a, const big_int& b) { ^ numere_mari.cpp:43:32: error: 'big_int' does not name a type friend bool operator == (const big_int& a, const big_int& b) { ^ numere_mari.cpp:43:41: error: ISO C++ forbids declaration of 'a' with no type [-fpermissive] friend bool operator == (const big_int& a, const big_int& b) { ^ numere_mari.cpp:43:50: error: 'big_int' does not name a type friend bool operator == (const big_int& a, const big_int& b) { ^ numere_mari.cpp:43:59: error: ISO C++ forbids declaration of 'b' with no type [-fpermissive] friend bool operator == (const big_int& a, const big_int& b) { ^ numere_mari.cpp:43:60: error: 'bool operator==(const int&, const int&)' must have an argument of class or enumerated type friend bool operator == (const big_int& a, const big_int& b) { ^ numere_mari.cpp:47:1: error: 'friend' used outside of class friend bool operator < (const big_int& a, const big_int& b) { ^ numere_mari.cpp:47:31: error: 'big_int' does not name a type friend bool operator < (const big_int& a, const big_int& b) { ^ numere_mari.cpp:47:40: error: ISO C++ forbids declaration of 'a' with no type [-fpermissive] friend bool operator < (const big_int& a, const big_int& b) { ^ numere_mari.cpp:47:49: error: 'big_int' does not name a type friend bool operator < (const big_int& a, const big_int& b) { ^ numere_mari.cpp:47:58: error: ISO C++ forbids declaration of 'b' with no type [-fpermissive] friend bool operator < (const big_int& a, const big_int& b) { ^ numere_mari.cpp:47:59: error: 'bool operator<(const int&, const int&)' must have an argument of class or enumerated type friend bool operator < (const big_int& a, const big_int& b) { ^ numere_mari.cpp:58:1: error: 'big_int' does not name a type big_int big_int::abs() const { ^ numere_mari.cpp:64:1: error: 'big_int' does not name a type big_int big_int::operator - () const { ^ numere_mari.cpp: In function 'std::string add_strings(std::string, std::string)': numere_mari.cpp:75:24: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] while (i < n1.size() || i < n2.size() || carry) { ^ numere_mari.cpp:75:41: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] while (i < n1.size() || i < n2.size() || carry) { ^ numere_mari.cpp:76:40: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] int sum = carry + (i < n1.size() ? n1[i] - '0' : 0) + (i < n2.size() ? n2[i] - '0' : 0); ^ numere_mari.cpp:76:76: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] int sum = carry + (i < n1.size() ? n1[i] - '0' : 0) + (i < n2.size() ? n2[i] - '0' : 0); ^ numere_mari.cpp: In function 'std::string sub_strings(std::string, std::string)': numere_mari.cpp:88:33: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int i = 0; i < n1.size(); i++) { ^ numere_mari.cpp:89:57: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] int sub = (n1[i] - '0') - borrow - (i < n2.size() ? n2[i] - '0' : 0); ^ numere_mari.cpp: At global scope: numere_mari.cpp:98:1: error: 'big_int' does not name a type big_int big_int::operator + (const big_int& b) const { ^ numere_mari.cpp:115:1: error: 'big_int' does not name a type big_int big_int::operator - (const big_int& b) const { ^ numere_mari.cpp:119:1: error: 'big_int' does not name a type big_int big_int::operator * (const big_int& b) const { ^ numere_mari.cpp:137:1: error: 'big_int' does not name a type big_int big_int::operator / (const big_int& b) const { ^ numere_mari.cpp:155:1: error: 'big_int' does not name a type big_int big_int::operator % (const big_int& b) const { ^ numere_mari.cpp:160:1: error: 'friend' used outside of class friend istream& operator >> (istream& in, big_int& n) { ^ numere_mari.cpp:160:43: error: 'big_int' has not been declared friend istream& operator >> (istream& in, big_int& n) { ^ numere_mari.cpp: In function 'std::istream& operator>>(std::istream&, int&)': numere_mari.cpp:162:18: error: 'big_int' was not declared in this scope n = big_int(s); ^ numere_mari.cpp: At global scope: numere_mari.cpp:166:1: error: 'friend' used outside of class friend ostream& operator << (ostream& out, const big_int& n) { ^ numere_mari.cpp:166:50: error: 'big_int' does not name a type friend ostream& operator << (ostream& out, const big_int& n) { ^ numere_mari.cpp:166:59: error: ISO C++ forbids declaration of 'n' with no type [-fpermissive] friend ostream& operator << (ostream& out, const big_int& n) { ^ numere_mari.cpp: In function 'std::ostream& operator<<(std::ostream&, const int&)': numere_mari.cpp:167:20: error: invalid conversion from 'int' to 'const char*' [-fpermissive] out << (string)n; ^ In file included from /usr/include/c++/4.8/string:52:0, from /usr/include/c++/4.8/bits/locale_classes.h:40, from /usr/include/c++/4.8/bits/ios_base.h:41, from /usr/include/c++/4.8/ios:42, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/sstream:38, from /usr/include/c++/4.8/complex:45, from /usr/include/c++/4.8/ccomplex:38, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52, from numere_mari.cpp:1: /usr/include/c++/4.8/bits/basic_string.h:490:7: error: initializing argument 1 of 'std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' [-fpermissive] basic_string(const _CharT* __s, const _Alloc& __a = _Alloc()); ^ numere_mari.cpp: In function 'int main()': numere_mari.cpp:173:5: error: 'big_int' was not declared in this scope big_int a = 96, b("420"); ^ numere_mari.cpp:173:13: error: expected ';' before 'a' big_int a = 96, b("420"); ^ numere_mari.cpp:174:12: error: 'a' was not declared in this scope cin >> a >> b; ^ numere_mari.cpp:174:17: error: 'b' was not declared in this scope cin >> a >> b; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Numere Mari face parte din a doua categorie. Pentru aceste probleme se folosește un program suport, furnizat de propunătorul problemei. 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ă.