Quantcast
Channel: CodeChef Discuss - latest questions
Viewing all articles
Browse latest Browse all 40121

Why i am getting compilation error?

$
0
0

Could someone please tell me why i keep getting compilation errors when submit my code

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace experiment
{
    class Program
    {
        static void Main(string[] args)
        {
            long t = long.Parse(Console.ReadLine());
            List<long> lines = new List<long>();
            for (int i = 0; i <t; i++)
            {
                lines.Add(long.Parse(Console.ReadLine()));
            }
            foreach (long x in lines)
            {
                long result=1;
                for (long i = x; i>=1; i--)
                {
                    result = result * i;
                }
                Console.WriteLine(result);
            }
            Console.ReadLine();
        }
    }
}

for some reason it keeps giving me compilation errors when i submit the code.could somebody please tell what i need to do to get it fixed


Viewing all articles
Browse latest Browse all 40121

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>