2014-08-30 3 views
-4

파스칼을 사용하여 새 프로그램을 만들고 7 개의 11 번째 게임을 프로그래밍해야합니다. 몇 가지 팁을 줄 수 있습니까?파스칼을 사용하는 첫 번째 프로그램

필자는 시도 :

program sevele; 
var capitalinicial: integer 
begin 
    writeln('ingrese un capital') 
    readln(capitalinicial) 
    writeln('su capital es capitalinicial') 
+1

당신은 여러 세미콜론 일부'end'를 그리워 작동하는 방법이다 소스 코드를 컴파일해야합니다. –

답변

1

귀하의 질문에 대답, 당신이 알아야 할 몇 가지가 있습니다

당신은 키워드 후를 제외하고, 모든 문장의 끝에 세미콜론 ;을 넣어야 할 제어 구조 (for, while, if, else 등)의 시작 또는 begin 또는 end 키워드 뒤에 오는 시작을 나타냅니다.

동일한 금액의 beginend 키워드를 사용하십시오. 프로그램의 마지막 end 다음에 점이옵니다.

writeln을 사용하면 하나 이상의 변수 또는 문자열을 인쇄 할 수 있습니다. 문자열을 인쇄하려면 간단한 따옴표 '을 사용하고 값을 출력하기 위해 따옴표가없는 변수의 이름 만 사용해야하고 다른 인수도 쉼표 ','로 구분해야합니다. 예를 들어

는 :

program example; 
var 
    a,b:integer; 
    begin 
    a:=3; 
    b:=5; 
    writeln ('this is just a string'); 
    writeln (a); 
    writeln (a,b); 
    writeln ('the value of a is: ',a,' and the value of b is: ',b); 
    readln; 
    end. 

당신은 아마 쓸 attemped 코드는 다음과 같습니다

program sevele; 
var capitalinicial: integer; 
begin 
    writeln('ingrese un capital'); 
    readln(capitalinicial); 
    writeln('su capital es ',capitalinicial); 
    readln; //use this to give you time to view the output 
end. 
0

이것은

program sevele; 
var capitalinicial: integer; 
begin 
writeln('ingrese un capital'); 
readln(capitalinicial); 
writeln('su capital es',capitalinicial); 
end. 
관련 문제