#3534
Multiset_OOP
C++
Definiți în C++ clasa Multiset care va implementa multiset-uri de numere naturale în care se definesc operațiile:
Insert(x)
– inserează x
în multisetErase(x)
– elimină elementul de pe pozitia x
din multisetFind(x)
– returnează valoarea de pe pozitia x
din multisetProblema | Multiset_OOP | Operații I/O |
multiset_oop.in /multiset_oop.out
|
---|---|---|---|
Limita timp | 0.35 secunde | Limita memorie |
Total: 30 MB
/
Stivă 5 MB
|
Id soluție | #54136190 | Utilizator | |
Fișier | multiset_oop.cpp | Dimensiune | 527 B |
Data încărcării | 20 Noiembrie 2024, 16:08 | Scor / rezultat | Eroare de compilare |
multiset_oop.cpp: In function 'int main()': multiset_oop.cpp:10:5: error: 'Multiset' was not declared in this scope Multiset ms(n); ^ multiset_oop.cpp:10:14: error: expected ';' before 'ms' Multiset ms(n); ^ multiset_oop.cpp:14:9: error: 'ms' was not declared in this scope ms.Insert(x); ^ multiset_oop.cpp:21:13: error: 'ms' was not declared in this scope ms.Insert(x); ^ multiset_oop.cpp:23:13: error: 'ms' was not declared in this scope ms.Erase(x); ^ multiset_oop.cpp:24:22: error: 'ms' was not declared in this scope else cout << ms.Find(x) << '\n'; ^ multiset_oop.cpp: At global scope: multiset_oop.cpp:53:5: error: redefinition of 'int n' int n, q, op, x; ^ multiset_oop.cpp:6:5: error: 'int n' previously declared here int n, q, op, x; ^ multiset_oop.cpp:53:8: error: redefinition of 'int q' int n, q, op, x; ^ multiset_oop.cpp:6:8: error: 'int q' previously declared here int n, q, op, x; ^ multiset_oop.cpp:53:11: error: redefinition of 'int op' int n, q, op, x; ^ multiset_oop.cpp:6:11: error: 'int op' previously declared here int n, q, op, x; ^ multiset_oop.cpp:53:15: error: redefinition of 'int x' int n, q, op, x; ^ multiset_oop.cpp:6:15: error: 'int x' previously declared here int n, q, op, x; ^ multiset_oop.cpp: In function 'int main()': multiset_oop.cpp:54:5: error: redefinition of 'int main()' int main() ^ multiset_oop.cpp:7:5: error: 'int main()' previously defined here int main() ^ multiset_oop.cpp:59:5: error: 'Multiset' was not declared in this scope Multiset ms(n); ^ multiset_oop.cpp:59:14: error: expected ';' before 'ms' Multiset ms(n); ^ multiset_oop.cpp:63:9: error: 'ms' was not declared in this scope ms.Insert(x); ^ multiset_oop.cpp:70:13: error: 'ms' was not declared in this scope ms.Insert(x); ^ multiset_oop.cpp:72:13: error: 'ms' was not declared in this scope ms.Erase(x); ^ multiset_oop.cpp:75:13: error: 'ms' was not declared in this scope cout << ms.Find(x); ^ multiset_oop.cpp:56:43: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result] freopen("multiset_oop.in", "r", stdin); ^ multiset_oop.cpp:57:45: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result] freopen("multiset_oop.out", "w", stdout); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Multiset_OOP 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ă.