Pascal的程式名稱

2006-12-24 4:04 am
program Wages(output);
var
Wages,HoursWorked,PayRate:integer;
begin
write('Please enter the HoursWorked:');
readln(HoursWorked);
write('Please enter the PayRate:');
readln(PayRate);
Wages:=HoursWorked*PayRate;
writeln('Wages=$',Wages);
readln
end.
請問為何這程式不能順利編譯?我若改了程式名稱又行?

回答 (1)

2007-01-01 7:21 am
✔ 最佳答案
name collision.. Wages is used as the program name and the variable name.. when you changed the program name.. the name collision disappears, therefore you can compile it successfully
參考: me


收錄日期: 2021-04-18 22:15:28
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20061223000051KK03638

檢視 Wayback Machine 備份