#C12459. Simulate Microservices Execution

    ID: 41888 Type: Default 1000ms 256MiB

Simulate Microservices Execution

Simulate Microservices Execution

In modern distributed systems, microservices work together to handle various functionalities. In this problem, you are required to simulate three microservices: User Service, Product Service, and Order Service. Each service has a specific response when activated:

  • When the service code is 1, the service should output: (\text{User Service Running}).
  • When the service code is 2, the service should output: (\text{Product Service Running}).
  • When the service code is 3, the service should output: (\text{Order Service Running}).

Your task is to write a program that reads a sequence of service calls from standard input and prints the corresponding responses to standard output. This simulation reflects a microservices architecture where each service operates independently but collectively forms part of a larger system.

inputFormat

The first line contains a single integer (T) representing the number of service calls. Each of the following (T) lines contains an integer which will be either 1, 2, or 3. These integers represent the service codes for:

1: User Service 2: Product Service 3: Order Service

outputFormat

For each service call in the input, output the corresponding response on a new line:

  • For service code 1: output (\text{User Service Running})
  • For service code 2: output (\text{Product Service Running})
  • For service code 3: output (\text{Order Service Running})## sample
3
1
2
3
User Service Running

Product Service Running Order Service Running

</p>