Not a member of Pastebin yet?
                        Sign Up,
                        it unlocks many cool features!                    
                - using System;
 - using System.Linq;
 - using System.Collections.Generic;
 - namespace PrintDeckOfCards
 - {
 - class Program
 - {
 - static void Main()
 - {
 - int N = int.Parse(Console.ReadLine());
 - int x = int.Parse(Console.ReadLine());
 - double sum = 1;
 - int factoriel = 1;
 - for (int i = 1; i <= N; i++)
 - {
 - factoriel *= i;
 - sum += factoriel / Math.Pow(x, i);
 - }
 - Console.WriteLine($"{sum:F5}");
 - }
 - }
 - }
 
Advertisement
 
                    Add Comment                
                
                        Please, Sign In to add comment