fbinnzhivko

02.02 Nums

May 16th, 2016
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.46 KB | None | 0 0
  1. using System;
  2. class Program
  3. {
  4.     static void Main()
  5.     {
  6.         var n = decimal.Parse(Console.ReadLine());
  7.         var m = decimal.Parse(Console.ReadLine());
  8.  
  9.         for (decimal i = n; i <= m; i++)
  10.         {
  11.             if (i % 2 == 0)
  12.             {
  13.                 Console.WriteLine("{0:f3}", Math.Sqrt((double)i));
  14.             }
  15.             else
  16.             {
  17.                 Console.WriteLine("{0:f3}", i * i);
  18.             }
  19.         }
  20.     }
  21. }
Add Comment
Please, Sign In to add comment