2道VB 题目 谢谢高手帮忙下
发布网友
发布时间:2023-11-16 20:45
我来回答
共1个回答
热心网友
时间:2024-11-08 06:55
public sub prime;
dim k as integer;
dim a(1000) as integer;
k:=1;a[1]=3;
for i=2 to 1000
p=true;
for j=2 to (i-1) do if (i mod j=0) then p=false;
if p then
k=k+1;
a[k]=i;
if (a[k]-a[k-1]=2) then print i;
end;
next i
end sub;
public sub san;
dim a,b,c as integer;
input a,b,c;
if (a+b>c)and(a+c>b)and(b+c>a) then
p:=(a+b+c)/2;
print sqr(p*(p-a)*(p-b)*(p-c));
else
print 'No!'
endif
end sub;