Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- namespace ConsoleApp4
- {
- class Program
- {
- static void Main(string[] args)
- {
- double[] nums = Console.ReadLine().Split(' ').Select(double.Parse).ToArray(); ;
- //int[] arr = new int[nums.Length];
- for (int i = 0; i < nums.Length; i++)
- {
- int roundNums = (int)Math.Round(nums[i], MidpointRounding.AwayFromZero);
- Console.WriteLine($"{nums[i]} => {roundNums}");
- }
- // for (int i = 0; i < nums.Length; i++)
- // {
- // Console.WriteLine($"{nums[i]} => {arr[i]}");
- // }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment