You are viewing a single comment's thread. Return to all comments →
//c # using System; using System; using System.Collections.Generic; using System.IO; class Solution { static void Main(String[] args) { var t = Convert.ToInt32(Console.ReadLine()); for(int i=0; i= 0; i--) sum+=number[i]; Console.WriteLine(sum); } static int Multiply(int times, int[] number,int numLength) { int carry = 0; for (int i = 0; i < numLength; i++) { int product = number[i] * times + carry; number[i] = product % 10; carry = product / 10; }
while (carry != 0) { number[numLength] = carry % 10; carry /= 10; numLength++; } return numLength; }
}
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #20: Factorial digit sum
You are viewing a single comment's thread. Return to all comments →
//c # using System; using System; using System.Collections.Generic; using System.IO; class Solution { static void Main(String[] args) { var t = Convert.ToInt32(Console.ReadLine()); for(int i=0; i= 0; i--) sum+=number[i]; Console.WriteLine(sum); } static int Multiply(int times, int[] number,int numLength) { int carry = 0; for (int i = 0; i < numLength; i++) { int product = number[i] * times + carry; number[i] = product % 10; carry = product / 10; }
}