Witam napisałem taki kod (C#)
dostaję błędną odpowiedź
Dodałem to ograniczenie do silni 20 bo wczesniej dostawałem przekroczono czas
help
private static double sil( double x)
{
if(x==0) return 1;
else return x*sil(x-1);
}
public static void Main(string[] args)
{
int zero=0;
int menu;
menu= Int32.Parse(Console.ReadLine());
double[] a= new double[menu];
string[] s= new string[menu];
for (int x=0; x<menu; x++)
{
a[x]=Double.Parse(Console.ReadLine());
if(a[x]>20){
break;
}
else
a[x]=sil(a[x]);
s[x]=a[x].ToString(s[x]);
if(s[x].Length<2){
Console.WriteLine("{0} {1}",zero,char.GetNumericValue(s[x],s[x].Length-1));
}
else
Console.WriteLine("{0} {1}",char.GetNumericValue(s[x],s[x].Length-2),char.GetNumericValue(s[x],s[x].Length-1));
}
}