How can I realize a equations like this in C# with custom inputs?
Input is amount of Legs, and the amount of animals.
animals: 35
legs: 94
x: Cows
y: Hens
Amount of animals
x + y = 35
y = 35 - x
Amount of legs
Hens: 2 legs
Cows: 4 legs
4x + 2y = 94
->
4x + 2y = 94
4x + 2(35 - x) = 94
4x + 70 - 2x = 94
2x = 24
x = 12
y = 35 - x = 35 - 12 = 23
-> 12 Cows -> 23 Hens