#include <iostream> using namespace std; void process(const int& x ){ cout<<"readonly"; } void process(int& x){ x=x*2; } // Write your two overloaded process() functions here int main() { int x; std::cin >> x; if (x < 0) { process(static_cast<const int&>(x)); // call read-only overload } else { process(x); // call modifying overload std::cout << x; } return 0; }
Test Cases
Test Results
Input
5
Expected Output
10