⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ro2cls11.pas

📁 This ar the basic programs that i did in highschool. From very simple to medium programs. From array
💻 PAS
字号:
{verificati dak e ciclu elementar}
type vector=array[1..50] of integer;
var v,v1:vector;
    a:array[1..50,1..50]of integer;
    m,n,i,j,k,p,q:integer;
    f:text;
function elementar(v:vector;q:integer):boolean;
var i,j:integer;
    ok:boolean;
begin
ok:=true;
for i:=1 to q do
   if (v[i]<1) or (v[i]>n) then ok:=false;
if ok then
 if v[i]<>v[q] then ok:=false;
if ok then
 for i:=1 to q-1 do
   if a[v[i],v[i+1]]=0 then ok:=false;
{if ok then
 for i:=1 to q-2 do
  for j:=i+1 to q-1 do
   if ((v[i]=v[j]) and (v[i+1]=v[j+1])) or ((v[i]=v[j+1]) and (v[i+1]=v[j]))
    then ok:=false;  }
if ok then
  for i:=2 to q-1 do
   for j:=i+1 to q do
          if v[i]=v[j] then ok:=false;
elementar:=ok;
end;
begin
assign(f, 'graf.txt');
reset(f);
readln(f,m,n);
for p:=1 to m do begin
                 readln(f,i,j);
                 a[i,j]:=1;
                 a[j,i]:=1;
                 end;
{while not eof(f) do begin
                    inc(q);
                    readln(f,v1[q]);
                    end;    }
close(f);
for i:=1 to q do begin
                 write('v1[',i,']=');
                 readln(v1[i]);
                 end;
if elementar(v1,q) then write('este ciclu elementar ')
                   else write('nu este ciclu elementar');
writeln;
end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -