pascal 代码

日期:2018-04-13 14:01:24 人气:1

pascal 代码

const MAX = 1000;var i,j,n,s:longint; opt:array[1..MAX]of longint;begin readln(n); s:=0; for i:=1 to n do begin opt[i]:=1; for j:=1 to i-2 do inc(opt[i],opt[j]); inc(s,opt[i]); end; writeln(s);end.如果一个人都不采访也算一种情况,则最后答案还要加1.
    A+
热门评论