A school warm-up exercise to occupy your time - page 3

 
Renat Akhtyamov:

"per calf - 0.5 0.5 roubles"

How do you understand that?

all figures duplicated

 
Iurii Tokman:

all the numbers duplicated

I take it this branch is about who's cooler at googling?

An old problem. How many bulls, cows and calves can be bought for 100 roubles, if 100 cattle are to be bought, and the price of a bull is 10 roubles, the price of a cow is 5 roubles, and the price of a calf is 0,5 roubles?

Answer

program prim3
uses crt;
var b, k, t: integer;
begin
clrscr;
for b:=0 to 10 do
for k:=0 to 20 do
for t:=0 to 200 do
if(20*b+10*k+t=200) and (b+k+t=100)
then
writeln('bulls ', b, 'cows ', k ' calves ', t);
readln;
end.

 
Iurii Tokman:

Ancient task

There is 100 roubles.
How many bulls, cows and calves can be bought with all this money,
if the fee for a bull is 10 rubles,
for a cow is 5 rubles,
for a calf is 0.5 rubles
and 100 cattle have to be bought?

solve with nested cycles

1 bull, 9 cows and 90 calves

The Diophantus equation (if prices are counted in fifty cents)

 
Renat Akhtyamov:

i take it this branch is who's the cooler googler?

how much do you get?

i used python to solve this problem.

 

Here's more, better to decide without googling, then there's no point



 

*

 
Iurii Tokman:

How much is it?

i solved this problem in python

Let me better ask my own problem closer to the subject ;)

I finally remembered how I was doing one of my strategies with forecasting ;))))

I wrote somewhere on a forum that a forecast is the simplest school problem ;)

Suppose the price moves along a parabola

Which decision will be rejected - BUY or SELL ?

I wrote about it here somewhere, maybe the picture will correct, I'm reading it because my old nickname was deleted

https://www.mql5.com/ru/forum/37348/page69#comment_1158229

picture:


FOREX - Тенденции, прогнозы и следствия
FOREX - Тенденции, прогнозы и следствия
  • 2014.11.05
  • www.mql5.com
FOREX - Тенденции, прогнозы и следствия.
Files:
 
Iurii Tokman:

Ancient task

There is 100 roubles.
How many bulls, cows and calves can be bought with all this money,
if the fee for a bull is 10 rubles,
for a cow is 5 rubles,
for a calf is 0.5 rubles
and you have to buy 100 cattle?

solve with nested cycles

1+9+90 but that's it, in my mind almost without cycles, even/odd: Calves should divide by 10, others in total too, bulls and cows an odd number

 
Interestingly, none of the youngsters take part. They're not interested. Vibrating on my granddaughter. So far, languages seem interesting. Maths is hard to pull off.
 
Iurii Tokman:

Ancient problem

There is 100 roubles.
How many bulls, cows and calves can be bought with all this money,
if the fee for a bull is 10 roubles,
for a cow is 5 roubles,
for a calf is 0.5 roubles
and 100 cattle have to be bought?

solve with nested loops

.

Reason: