Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace _01.DataTypes
- {
- using System;
- public class Program
- {
- public static void Main()
- {
- string type = Console.ReadLine();
- switch (type)
- {
- case "int":
- int inputInt = int.Parse(Console.ReadLine());
- Console.WriteLine(inputInt * 2);
- break;
- case "real":
- double inputDouble = double.Parse(Console.ReadLine());
- Console.WriteLine($"{inputDouble * 1.5:F2}");
- break;
- case "string":
- string inputString = Console.ReadLine();
- Console.WriteLine("$" + inputString + "$");
- break;
- default:
- break;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment