Подсчитать количество целых среди чисел а, b, с.
Составить программу.
var a, b, c:real;
count:integer;begin count := 0; write('a = '); readln(a); write('b = '); readln(b); write('c = '); readln(c); if Frac(a) = 0 then count := count + 1; if Frac(b) = 0 then count := count + 1; if Frac(c) = 0 then count := count + 1; writeln('Целых чисел - ', count);end.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Verified answer
var
a, b, c:real;
count:integer;
begin
count := 0;
write('a = '); readln(a);
write('b = '); readln(b);
write('c = '); readln(c);
if Frac(a) = 0 then
count := count + 1;
if Frac(b) = 0 then
count := count + 1;
if Frac(c) = 0 then
count := count + 1;
writeln('Целых чисел - ', count);
end.