prog.cs(2,18): error CS8025: Parsing error Compilation failed: 1 error(s), 0 warnings

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

Hi i submitted my code but i keeps telling me error CS8025 Parsing error compilation failed.
i don’t understand what that means and by the way this was my solution for the small factorial problem

in the code you wrote there, maybe you could try to remove the ‘experiment’ namespace.


http://www.codechef.com/viewsolution/1779808

you probably did a mistake in copy pasting, because it’s definitely not C# code. :slight_smile:


http://www.codechef.com/viewsolution/1774372

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

you don’t need every one of those. maybe you could try to just use the System namespace only.


here you can find every AC solution in C# for the small factorial problem.

hope it helps !

Hi,I’ve tried your Codes and they work correctly . if your error is a runtime one maybe your problem is in the input string I mean maybe you use something such as space in your input string .

GoodLuck

//