fork download
  1. #include <iostream>
  2.  
  3. class Item{
  4. private:
  5. int key;
  6. int data;
  7. public:
  8. Item(){ key = 0; data = 0; }
  9. Item(int data, int key){
  10. this->data = data;
  11. this->key = key;
  12. }
  13. bool operator <(Item &item){ return data < item.data; }
  14. bool operator >(Item &item){ return data > item.data; }
  15. };
  16.  
  17. template<class Item>
  18. class PQ{
  19. PQ(int);
  20. int empty() const;
  21. void insert(Item);
  22. Item getmax();
  23. };
  24.  
  25. int main(){
  26. int p;
  27. Item a(7, 1);
  28. Item b(7, 2);
  29. std::cout << (a < b) << std::endl;
  30. std::cout << (a > b) << std::endl;
  31.  
  32. return 0;
  33. }
Success #stdin #stdout 0s 3412KB
stdin
Standard input is empty
stdout
0
0