0
我剛開始學習帕斯卡語言,這是一個新的論壇2.原諒我的錯誤,並告訴我如何繼續。我希望在Pascal語言的這個算法的末尾提供一些幫助來正確地寫出輸出,有人可以幫我解決這個問題嗎?我收到這條消息:37行(最後一行)出現Sitax錯誤,CPY沒有預期。馬達面料帕斯卡成本利潤
Program MotorsFabric ;
var
Production, { Production of types of motors}
CPM: array [1..12,1..2] of integer; { Cost per mounth}
Values: array [1..2,1..2] of integer; { Cost and Profit of each motor }
CPY: array [1..2] of integer; { Cost per Year}
I,J,K: integer; { Auxs}
Begin
for I := 1 to 12 do
for J := 1 to 2 do { read Production }
read(Production [I,J]);
for I := 1 to 2 do
for J := 1 to 2 do { read values }
read (Values [I,J]);
for I := 1 to 12 do
for J := 1 to 2 do { Costs and Profits per mounth}
begin
CPM [I,J] := CPM
[I,J] + Production [I,K] * Values[K,J]
end;
for J := 1 to 2 do
begin
CPY [J] := 0; { Costs an Profits per Year }
for I := 1 to 12 do
CPY[J] := CPY[J] + CPM [I,J]
end;
for I := 1 to 12 do
begin { Writing results }
for J := 1 to 2 do
write (CPM [I,J]:10);
writeLn
end;
writeLn ('Cost per Year :' CPY[1], ' Profit per Year :', CPY[2]);
End.
你以後忘了逗號 '每年費用:'。 – BitTickler
如果錯誤確實只是一個錯字,考慮刪除這個問題,因爲它不可能對其他人有用。 – m69