program SnailClimb;varV, U, H, D, day, total: integer;beginwriteln('Enter the height of the tree (H):');readln(H);
writeln('Enter the distance climbed during the day (V):');readln(V);
writeln('Enter the distance slid down during the night (U):');readln(U);
day := 0;total := 0;
repeatday := day + 1;total := total + V;
until false;
writeln('The snail will climb to the top in ', day, ' days.');
end.
program SnailClimb;
var
V, U, H, D, day, total: integer;
begin
writeln('Enter the height of the tree (H):');
readln(H);
writeln('Enter the distance climbed during the day (V):');
readln(V);
writeln('Enter the distance slid down during the night (U):');
readln(U);
day := 0;
total := 0;
repeat
if total >= H thenday := day + 1;
total := total + V;
break;
total := total - U;
until false;
writeln('The snail will climb to the top in ', day, ' days.');
end.