Guest User

Untitled

a guest
Nov 29th, 2018
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. namespace _01.DataTypes
  2. {
  3. using System;
  4.  
  5. public class Program
  6. {
  7. public static void Main()
  8. {
  9. string type = Console.ReadLine();
  10.  
  11. switch (type)
  12. {
  13. case "int":
  14. int inputInt = int.Parse(Console.ReadLine());
  15. Console.WriteLine(inputInt * 2);
  16. break;
  17. case "real":
  18. double inputDouble = double.Parse(Console.ReadLine());
  19. Console.WriteLine($"{inputDouble * 1.5:F2}");
  20. break;
  21. case "string":
  22. string inputString = Console.ReadLine();
  23. Console.WriteLine("$" + inputString + "$");
  24. break;
  25. default:
  26. break;
  27. }
  28. }
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment