Id and Ship Problem Code: FLOW010 (CodeChef)
Write a program that takes in a letterclass ID of a ship and display the equivalent string class description of the given ID. Use the table below.
Class ID | Ship Class |
---|---|
Input
The first line contains an integer T, the total number of testcases. Then T lines follow, each line contains a character.
Output
For each test case, display the Ship Class depending on ID, in a new line.
Constraints
- 1 ≤ T ≤ 1000
Example
Input 3 B c D Output BattleShip Cruiser Destroyer
Solution:
t=int(input()) Id = {'B':"BattleShip","C":"Cruiser","D":"Destroyer","F":"Frigate",'b':"BattleShip","c":"Cruiser","d":"Destroyer","f":"Frigate"} for i in range (t): k=input() print(Id[k])
Comments
Post a Comment