I didn't try it myself but that you Code don't Work let me belive that the Last 3 Test cases aren't Just 3 Elements. You Code's just for 3 elements but the Challenge say nothing about just 3 Elements.
I would recommend you to try the List.Sort() Method to find out about the biggest payment and then calculate.
I would Most likely do it Like that:
List<double> list = new List<double>();
double discount = 0.7;
double taxes = 1.07;
input = Console.ReadLine();
foreach(string word in input.Split(','))
double nums = Convert.ToDouble(word);
nums.Sort((a, b) => b.CompareTo(a));
int sumb = nums.Sum()*taxes;
for(int i = 1; i < nums.Count; i++)
nums[i] *= discount;
Console.WriteLine(Math.Floor(sumb - nums.Sum()*taxes));
The Code is probably false but I hope the idea how it could be done goes through. :)
printf("enter two numbers");
printf("greater number is %d", number1);
printf("greater number is %d", number2);
What is the mistake on this?