码迷,mamicode.com
首页 > 其他好文 > 详细

Pascal之工种问题

时间:2017-01-20 10:55:34      阅读:128      评论:0      收藏:0      [点我收藏+]

标签:div   技术分享   console   img   user   type   adl   asc   ons   

 1 program Project2;
 2 Type
 3   ma=(A,B,C);
 4   wk=1..3;
 5   const
 6   x:array[ma,wk] of integer
 7     =((4,3,3),(2,4,3),(4,5,2));
 8 var
 9   maxefficiency:array[wk] of wk;
10   i,j,k:wk;
11   s:integer;
12   m:integer;
13 
14 {$APPTYPE CONSOLE}
15 begin
16   { TODO -oUser -cConsole Main : Insert code here }
17   m:=0;
18   for i:=1 to 3 do
19    for j:=1 to 3 do
20    if i<>j then
21     begin
22     k:=6-i-j;
23     s:=x[A,i]+x[B,j]+x[C,k];
24      if s>m then
25       begin
26       m:=s;
27       maxefficiency[1]:=i;
28       maxefficiency[2]:=j;
29       maxefficiency[3]:=k;
30       end;
31       end;
32       for i:=1 to 3 do
33       writeln(工人:6,chr(64+i),工种:6,maxefficiency[i]);
34       writeln(最大效益 :12,m:4);
35       readln;
36       end.

技术分享

技术分享

Pascal之工种问题

标签:div   技术分享   console   img   user   type   adl   asc   ons   

原文地址:http://www.cnblogs.com/lanjianhappy/p/6322101.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!