Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Program
- {
- static void Main(string[] args)
- {
- string st = Console.ReadLine();
- MyMethod(st);
- }
- static void MyMethod(string type)
- {
- if(type=="int")
- {
- int n = int.Parse(Console.ReadLine());
- Console.WriteLine(n);
- }
- else if(type=="string")
- {
- string str = Console.ReadLine();
- Console.WriteLine("$" + str + "$");
- }
- else if(type=="real")
- {
- double d = double.Parse(Console.ReadLine());
- double result = d * 1.5;
- Console.WriteLine($"{result:F2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement