Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- namespace apps
- {
- class Program
- {
- static void Main(string[] args)
- {
- //rounding numbebrs
- string text = Console.ReadLine();
- int total = 0;
- string[] Separated = text.Split(' ');
- double[] Nums = new double[Separated.Length];
- for (int i = 0; i < Separated.Length; i++)
- {
- Nums[i] = Convert.ToDouble(Separated[i]);
- Nums[i] = Math.Round(Nums[i], MidpointRounding.AwayFromZero);
- if (Nums[i] == -0) { Nums[i] = 0; }
- Console.WriteLine($"{Separated[i]} => {Nums[i]}");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement