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

📄 p1926.dpr

📁 高手写的所有acm例程 在acm.zju.edu.cn 上的题目的例程
💻 DPR
字号:
program p1926;

{$APPTYPE CONSOLE}

var
        ask     :array[1..10]of boolean;
        hol     :array[1..10]of integer;
        ans     :integer;
        s       :string;
        check   :boolean;
        n       :integer;
        t       :integer;
        i       :Integer;
begin
readln(n);
while n<>0 do
        begin
        fillchar(ask,sizeof(ask),false);
        check:=true;
        repeat
        readln(s);
        if s='too high' then t:=1;
        if s='too low' then t:=0;
        if s='right on' then ans:=n else
                if (ask[n])and(hol[n]<>t) then check:=false else
                        begin
                        ask[n]:=true;
                        hol[n]:=t;
                        end;
        if s<>'right on' then readln(n);
        until s='right on';
        for i:=1 to 10 do
                if ask[i] then
                        begin
                        if ((hol[i]=1)and(i<ans))or((hol[i]=0)and(i>ans)) then
                        begin
                        check:=false;
                        break;
                        end;
                        end;
        if ask[ans] then check:=false;
        if check then writeln('Stan may be honest') else
                writeln('Stan is dishonest');
        readln(n);
        end;
end.

⌨️ 快捷键说明

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