2011-01-27 3 views
0

아래의 코드는 예외를 throw합니다. 왜?파스칼 프로그램에서 잘못된 표현

fatal: syntax error ";" expected but "identifier AMOUNT" found은 세미콜론 가야 :

program Masquerade(input, output); 
    Begin 
var amount, count, money : integer; 
writeln ('Welcome to the Wonder True Masquerade Band'); 
writeln ('Would you like to proceed? Yes/No'); 

var choice : String; 
readln (choice); 
End. 

오류를 예외?

답변

5

beginvar 다음에 넣습니다.

나는 몇 년 동안 파스칼 사용하지 않은 그것을 테스트 할 수있는 컴파일러가없는, 그러나 그것은 다음과 같이해야합니다 :

program Masquerade(input, output); 
var 
    amount, count, money : integer; 
begin 
    writeln ('Welcome to the Wonder True Masquerade Band'); 
... 
+2

을 정확히. 코드 블록 안에 파스칼로 변수를 선언 할 수 없습니다. – CodesInChaos