I can not think of the mathematical logic of the following question:
Three friends played in the lottery. If they win, the prize must be apportioned in proportion to the value that each gave to the bet.
The goal is to make a program that reads the value that each bettor invested and the value of the prize and in the end, inform how much each bettor would win the prize based on the amount invested.
To facilitate I have only the pseudocode outline.
float aposta1, aposta2, aposta3, premio, recebe1, recebe2, recebe3;
leia aposta1, aposta2, aposta3, premio;
The great difficulty for me is that there is no pre-defined range of bet values, making it difficult to create the algorithm.
In the algorithm I should preferably use fairly basic programming content, if possible even without conditionals.