free pascal问题
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/11/07 23:38:47
free pascal问题
问题共有三题,我是新手,
1.输入一个自然数n(n
问题共有三题,我是新手,
1.输入一个自然数n(n
1、
var k,i,j,n:longint;
begin
readln(n);
for i:=1 to n do
begin
for j:=1 to n-i do write(' ');
write(i);
for j:= 1 to ((i-1)*2-1) do write(' ');
if i=1 then writeln
else writeln(i);
end;
end.
2(1)、
var a,b,c,t:longint;
begin
a:=1;
b:=1;
t:=2;
while (c100;
writeln(t);
end.
3、
var sum,n,tmp:real;
begin
readln(n);
tmp:=n;
while (tmp>=n*0.001) do begi
sum:=sum+tmp;
tmp:=tmp*0.7;
sum:=sum+tmp;
end;
sum:=sum-tmp;
writeln(sum:0:2);
end.
望楼主采纳
var k,i,j,n:longint;
begin
readln(n);
for i:=1 to n do
begin
for j:=1 to n-i do write(' ');
write(i);
for j:= 1 to ((i-1)*2-1) do write(' ');
if i=1 then writeln
else writeln(i);
end;
end.
2(1)、
var a,b,c,t:longint;
begin
a:=1;
b:=1;
t:=2;
while (c100;
writeln(t);
end.
3、
var sum,n,tmp:real;
begin
readln(n);
tmp:=n;
while (tmp>=n*0.001) do begi
sum:=sum+tmp;
tmp:=tmp*0.7;
sum:=sum+tmp;
end;
sum:=sum-tmp;
writeln(sum:0:2);
end.
望楼主采纳