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.
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
Tips to Fix Formula Parse Errors
Check your formula inputs and make sure they’re correct.
Use the IFERROR function and display a different result if an error occurs.
Check your spelling and make sure all the parentheses are in the right places.
Make sure you’re using the correct operators.
This may help you,
Rachel Gomez