Advertisement
Lyubohd

TU_04

May 16th, 2018
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.41 KB | None | 0 0
  1. namespace Problem_04
  2. {
  3.     using System;
  4.  
  5.     public class StartUp
  6.     {
  7.         public static void Main()
  8.         {
  9.             int count = int.Parse(Console.ReadLine());
  10.             double R = 0;
  11.  
  12.             for (int i = 1; i <= count; i++)
  13.             {
  14.                 R += 1.0 / (1 + i);
  15.             }
  16.  
  17.             Console.WriteLine("Стойността е : {0:F5}", R);
  18.         }
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement