Вариант – 14
(из книги: “Алгоритмизация и программирование на
Турбо Паскале” В.C. Новичков)
Автор: SlavikS
Program lab_01;
{ Lab 01 variant 14 }
{Esli vi bolee ili menee sharite v paskale, i uverenni chto
smogite obyasnit` chto znachit "uses" i "clrscr" to, uberite vse scobocki
(budet pokrasivee :) Ostal`nim sovetuu prosto ubrat` vse sodergimoe v
etix scobkax (v pascale oni budut viglyadit` potemnee),
ne trogaya osnovnoy kod}
{uses
crt;}
var i,t,f,n,z:longint;
begin
i:=2;z:=0;t:=0;
{clrscr;}
writeln;writeln(' + + + + + + + + + +');writeln;
writeln (' Vvedite celoe chislo');
write(' ');Readln (f);
n:=f;
{clrscr;}
writeln;writeln(' + + + + + + + + + +');writeln;
Writeln (' Vse prostie deliteli dannogo chisla:');
writeln;
Repeat
if n mod i=0 then
begin
n:=trunc(n/i);
if z<>i then
writeln (' --> ',i); z:=i; t:=t+1;
end
else i:=i+1;
until i>trunc(n);
{if i=2 then
begin
clrscr;
writeln;writeln(' + + + + + + + + + +');writeln;
writeln (' Dannoe chislo imeet odin delitel` ');
writeln (' ravnii ',i);
end;
if i=f then
begin
clrscr;
writeln;writeln(' + + + + + + + + + +');writeln;
writeln (' Chislo ',f,' samo yavlyaetsya prostim');
end;}
writeln;writeln;writeln;
writeln(' Nagmite [Enter] ');
readln;
end.
|