3. 从七张扑克牌中,任取三张,有几种组合方法?编程输出所有组合形式。

program exLoop3_1;
var
    a, b, c, k : integer;
begin
     for a := 1 to 7 do
         for b := 1 to 7 do
             for c := 1 to 7 do
             if (a-b)*(b-c)*(c-a) <> 0 then
             begin
                  k := k+1;
                  writeln(a:3, b:3, c:3);
             end;
     writeln('All ', k, ' kinds.');
     readln;
end.
posted @ 2010-01-01 21:16  SmartIOI  阅读(352)  评论(0)    收藏  举报
本站采用CC授权如需转载、引用文章,请务必附上作者及来源处。 Creative Commons License