Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Numerics;
- namespace SomeNameSpace
- {
- class Program
- {
- static void Main(string[] args)
- {
- var number = Console.ReadLine();
- var split = number.Split('.');
- var secondPart = "";
- if (split[1].Length<3)
- {
- secondPart = split[1];
- for (int i = split[1].Length; i < 3; i++)
- {
- secondPart += "0";
- }
- }
- else
- {
- secondPart = split[1].Substring(0,3);
- }
- Console.WriteLine($"{split[0]}.{secondPart}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement