Advertisement
YavorGrancharov

Round_Away_From_Zero

Sep 3rd, 2017
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.50 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3.  
  4. namespace Round_Away_From_Zero
  5. {
  6.     class Program
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.             double[] arr = Console.ReadLine().Split().Select(double.Parse).ToArray();
  11.  
  12.             for (int i = 0; i < arr.Length; i++)
  13.             {
  14.                 Console.Write(arr[i] + " => ");
  15.                 Console.Write(Math.Round(arr[i], MidpointRounding.AwayFromZero));
  16.                 Console.WriteLine();
  17.             }
  18.         }
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement