Advertisement
Taniaaleksandrova

Untitled

Jun 3rd, 2020
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _03._Rounding_Numbers
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. string num = Console.ReadLine();
  10. string[] item = num.Split();
  11. double[] arrNum = new double[item.Length];
  12. for (int i = 0; i <= item.Length-1; i++)
  13. {
  14. arrNum[i] = double.Parse(item[i]);
  15. }
  16. for (int i = 0; i <=item.Length-1; i++)
  17. {
  18. Console.WriteLine($"{arrNum[i]} => {Math.Round(arrNum[i])}");
  19. }
  20. }
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement