fork download
  1. #include <iostream>
  2. #include <set>
  3. using namespace std;
  4. int main() {
  5. float n, x;
  6. cout << "To'plam elementlari soni: "; cin >> n;
  7. set <int> a;
  8. multiset <float> b,c;
  9. for (int i = 0; i < n; i++) {
  10. cin >> x;
  11. a.insert(x);
  12. }
  13.  
  14. cout << "B to'plam elementlari soni: "; cin >> n;
  15. for (int i = 0; i < n; i++) {
  16. cin >> x;
  17. b.insert(x);
  18. }
  19. cout << "C to'plam elementlari soni: "; cin >> n;
  20. for (int i = 0; i < n; i++) {
  21. cin >> x;
  22. c.insert(x);
  23. }
  24. cout << "B to'plamda:" << endl;
  25. for (auto i = a.begin(); i != a.end(); i++) {
  26. if (*i % 2 == 1) {
  27. cout << *i << ": ";
  28. if (b.find(*i) != b.end()) {
  29. cout << b.count(*i);
  30. cout << " marta qatnashgan" << endl;
  31. }
  32. else {
  33. cout << "0 marta qatnashgan" << endl;
  34. }
  35. }
  36. }
  37. cout << "C to'plamda:" << endl;
  38. for (auto i = a.begin(); i != a.end(); i++) {
  39. if (*i % 2 == 1) {
  40. cout << *i << ": ";
  41.  
  42. if (c.find(*i) != c.end()) {
  43. cout << c.count(*i);
  44. cout << " marta qatnashgan" << endl;
  45. }
  46. else {
  47. cout << "0 marta qatnashgan" << endl;
  48. }
  49. }
  50. }
  51. for (auto i = b.begin(); i != b.end(); i++) {
  52. a.insert(*i); }
  53. for (auto i = c.begin(); i != c.end(); i++) {
  54. a.insert(*i); }
  55. for (auto i = a.begin(); i != a.end(); i++) {
  56. cout << *i << " ";
  57. }
  58. return 0;}
Success #stdin #stdout 0.01s 5472KB
stdin
Standard input is empty
stdout
To'plam elementlari soni: B to'plam elementlari soni: C to'plam elementlari soni: B to'plamda:
C to'plamda:
-2147483648