fork download
  1. #include <vector>
  2. class IntersectionFlowRate
  3. {
  4. public:
  5. IntersectionFlowRate(int num = 4);
  6. void setFlowCycle(int index, int flow);
  7. void setFlowCar(int index, int flow);
  8. void setFlowTruck(int index, int flow);
  9. std::vector<int>& getFlowCycle() { return m_flowRateMotorCycle; }
  10. std::vector<int>& getFlowCar() { return m_flowRateCar; }
  11. std::vector<int>& getFlowTruck() { return m_flowRateTruck; }
  12.  
  13. private:
  14. std::vector<int> m_flowRateMotorCycle;
  15. std::vector<int> m_flowRateCar;
  16. std::vector<int> m_flowRateTruck;
  17. };
  18.  
  19. IntersectionFlowRate::IntersectionFlowRate(int num) :
  20. m_flowRateMotorCycle(num,0), m_flowRateCar(num,0), m_flowRateTruck(num,0)
  21. { }
  22.  
  23. int main()
  24. {
  25. IntersectionFlowRate flowRate(4);
  26. }
Success #stdin #stdout 0s 3452KB
stdin
Standard input is empty
stdout
Standard output is empty