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;
- namespace _3.P03_Rounding_numbers
- {
- class Program
- {
- static void Main(string[] args)
- {
- string numbers = Console.ReadLine(); // Вход 0.9 1.5 2.4 2.5 3.14
- string[] num = numbers.Split();
- double[] arr = new double[num.Length];
- for (int i = 0; i < arr.Length; i++)
- {
- arr[i] = double.Parse(num[i]);
- Console.WriteLine($"{num[i]} => {Math.Round(arr[i])}"); // Изход 0.9 => 11.5 => 22.4 => 22.5 => 33.14 => 3
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement