娄山中学noip吧 关注:137贴子:1,769
  • 3回复贴,共1

张大牛(jkljk67890)进

取消只看楼主收藏回复

在那道
里面这道题用If做是这样的:(goto版),我比较喜欢用goto……
label 1;
var
a,b,c:qword;
begin
readln(a,b,c);
if (a>b) and (a>c) then begin writeln(a); readln; goto 1; end;
if (a>b) and (c>a) then begin writeln(c); readln; goto 1; end;
if (a>c) and (b>a) then begin writeln(b); readln; goto 1; end;
if (a>c) and (b>c) and (a>b) then begin writeln(a); readln; goto 1; end;
if (a>c) and (b>c) and (b>a) then begin writeln(b); readln; goto 1; end;
if (a=b) and (c<a) then begin writeln(a); readln; goto 1; end;
if (a=b) and (c>a) then begin writeln(c); readln; goto 1; end;
if (a=c) and (b<a) then begin writeln(a); readln; goto 1; end;
if (a=c) and (b>a) then begin writeln(b); readln; goto 1; end;
if (b=c) and (a<c) then begin writeln(b); readln; goto 1; end;
if (b=c) and (a>c) then begin writeln(a); readln; goto 1; end;
if (a=b) and (c>a) then begin writeln(c); readln; goto 1; end;
if (a=c) and (b>a) then begin writeln(b); readln; goto 1; end;
if (b=c) and (a>b) then begin writeln(a); readln; goto 1; end;
if (a=b) and (a=c) and (b=c) then begin writeln(a); readln; goto 1; end;
if (c>a) and (c>b) then begin writeln(c); readln; goto 1; end;
if (c>a) and (b>c) then begin writeln(b); readln; goto 1; end;
if (c>b) and (a>c) then begin writeln(a); readln; goto 1; end;
if (c>b) and (a>b) and (c>a) then begin writeln(c); readln; goto 1; end;
if (c>b) and (a>b) and (a>c) then begin writeln(a); readln; goto 1; end;
if (b>a) and (b>c) then begin writeln(b); readln; goto 1; end;
if (b>a) and (c>b) then begin writeln(c); readln; goto 1; end;
if (b>c) and (a>c) and (a>b) then begin writeln(a); readln; goto 1; end;
if (b>c) and (a>c) and (b>a) then begin writeln(b); readln; goto 1; end;
readln;
1:end.
很多,很烦……



IP属地:上海1楼2012-05-02 19:30回复
    就是比较三个数大小的题……


    IP属地:上海2楼2012-05-02 19:31
    回复
      大牛我不信这道题目看不花死你


      IP属地:上海3楼2012-05-02 19:39
      回复
        24个if,zerojudge上传了5、6次,做了两天………………


        IP属地:上海4楼2012-05-02 19:40
        回复