Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- using System.Collections.Generic;
- using System.Numerics;
- using System.Text;
- namespace exampreparation
- {
- class exam
- {
- static void Main(string[] args)
- {
- string type = Console.ReadLine();
- string data = Console.ReadLine();
- Overload(type,data);
- }
- static void Overload(string type, string data)
- {
- if (type == "int")
- {
- int dataInt = int.Parse(data);
- dataInt *= 2;
- Console.WriteLine(dataInt);
- }
- else if (type == "real")
- {
- double dataDouble = double.Parse(data);
- dataDouble *= 1.5;
- Console.WriteLine($"{dataDouble:F2}");
- }
- else if (type == "string")
- {
- Console.WriteLine($"${data}$");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement