• + 0 comments
    C# 
    
    
    class Result
    {
    //i change this method to void and ref result instead of return as
    //there is an issue with ascii bla3
    
        public static void factorial(int n, ref int result)
        {
            for (Int32 i = n; i > 0; i--)
            {
                result *= i;
            }
        }
    }
    
    class Solution
    {
        public static void Main(string[] args)
        {
            Int32 n = Convert.ToInt32(Console.ReadLine());
    
            Int32 result = 1;
            
            Result.factorial(n,ref result);
    
            Console.WriteLine(result);
        }
    }