Round() pascal.
Round() pascal.
Π€ΡΠ½ΠΊΡΠΈΡ Round() Π²ΠΎΠ·Π²ΡΠ°ΡΠ°Π΅Ρ ΠΎΠΊΡΡΠ³Π»Π΅Π½Π½ΠΎΠ΅ Π΄ΠΎ ΡΠ΅Π»ΠΎΠ³ΠΎ ΡΠΈΡΠ»ΠΎ ΠΎΡ Π°ΡΠ³ΡΠΌΠ΅Π½ΡΠ°.
program Round_Task;
// Round(x) pascal
var
i_NUm: integer;
r_NUm: real;
begin
r_NUm := 2.889;
i_NUm := Round(r_NUm);
//ΠΡΠ²ΠΎΠ΄ Π½Π° ΡΠΊΡΠ°Π½ MININT
Writeln('Π Π΅Π·ΡΠ»ΡΡΠ°Ρ ΠΎΠΊΡΡΠ³Π»Π΅Π½ΠΈΠ΅ Π΄ΠΎ ΡΠ΅Π»ΠΎΠ³ΠΎ ΡΠΈΡΠ»Π°: ', i_NUm, ' ΠΎΡ ', r_NUm: 4: 2);
r_NUm := 7.124;
i_NUm := Trunc(r_NUm);
//ΠΡΠ²ΠΎΠ΄ Π½Π° ΡΠΊΡΠ°Π½ MININT
Writeln('Π Π΅Π·ΡΠ»ΡΡΠ°Ρ ΠΎΠΊΡΡΠ³Π»Π΅Π½ΠΈΠ΅ Π΄ΠΎ ΡΠ΅Π»ΠΎΠ³ΠΎ ΡΠΈΡΠ»Π°: ', i_NUm, ' ΠΎΡ ', r_NUm: 4: 2);
//Π·Π°Π²Π΅ΡΡΠ΅Π½ΠΈΠ΅ ΡΠ°Π±ΠΎΡΡ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΡ
WriteLn('ΠΠ°ΠΆΠΌΠΈΡΠ΅ <Enter>, ΡΡΠΎΠ±Ρ Π²ΡΠΉΡΠΈ.');
ReadLn();
end.
Π Π΅Π·ΡΠ»ΡΡΠ°Ρ:
Round () pascal.