|
|
back to boardwhy crash??????? using System; namespace ConsoleApplication5 { class Program { static void Main(string[] args) { int i,s=0; string[] A = Console.ReadLine().Split(' '); string[] B = Console.ReadLine().Split(' '); int min = int.Parse(A[1]); int car = int.Parse(A[0]); for (i = 0; i < min; i++) {
s = s + int.Parse(B[i]); } int a=s-(min*car); if (a >= 0) Console.WriteLine(a); else Console.WriteLine(0);
} } }
|
|
|