Advertisement
MartinTopchiev2

Int,Double,String

Nov 22nd, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Int_Double_String
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. string input = Console.ReadLine();
  10. int inputInt = 0;
  11. double inputDouble = 0;
  12. string inputString = "";
  13.  
  14. switch (input)
  15. {
  16. case ("integer"):
  17. {
  18. inputInt = int.Parse(Console.ReadLine());
  19. Console.WriteLine("{0}", inputInt + 1);
  20. break;
  21. }
  22. case ("real"):
  23. {
  24.  
  25. inputDouble = double.Parse(Console.ReadLine());
  26. inputDouble++;
  27. Console.WriteLine(string.Format("{0:F2}",inputDouble));
  28.  
  29.  
  30.  
  31. break;
  32.  
  33. }
  34. case ("text"):
  35. {
  36. inputString = Console.ReadLine();
  37. Console.WriteLine($"{inputString}*");
  38. break;
  39. }
  40. default:
  41. break;
  42. }
  43. }
  44. }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement