#include <iostream> class Timer { private: int period = 0; public: // TODO: Implement setPeriod // Argument name MUST be 'period' void setPeriod(int period) { this->period = period; } void log() { std::cout << "Timer Period: " << period << " ms" << std::endl; } }; int main() { Timer t; int N; if (!(std::cin >> N)) return 0; for (int i = 0; i < N; ++i) { int p; std::cin >> p; t.setPeriod(p); t.log(); } return 0; }
Test Cases
Test Results
Input
2 100 500
Expected Output
Timer Period: 100 ms Timer Period: 500 ms