Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class CalculatesTheSumS
- {
- static void Main()
- {
- long n = long.Parse(Console.ReadLine());
- long x = long.Parse(Console.ReadLine());
- double sequenceMember = 1;
- double sum = 1;
- for (int i = 1; i <= n; i++)
- {
- sequenceMember *= (double)i / x;
- sum += sequenceMember;
- }
- Console.WriteLine("{0:F5}",sum);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement