“嗨,伙計。Bilaabo 會告訴你這一切在 Pascal 中會是什麼樣子。”
帕斯卡
i := 3;
While i >= 0 Do
Begin
WriteLn(i);
i := i - 1;
End;
爪哇
int i = 3;
while (i >= 0)
{
System.out.println(i);
i--;
}
帕斯卡
i := 0;
While i < 3 Do
Begin
WriteLn(i);
i := i + 1;
End;
爪哇
int i = 0;
while (i < 3)
{
System.out.println(i);
i++;
}
帕斯卡
isExit := False;
While Not isExit Do
Begin
ReadLn(s);
isExit := (s = 'exit');
End;
爪哇
boolean isExit = false;
while (!isExit)
{
String s = buffer.readLine();
isExit = s.equals("exit");
}
帕斯卡
While True Do
WriteLn('C');
爪哇
while (true)
System.out.println('C');
帕斯卡
While True Do
Begin
ReadLn(s);
If s = 'exit' Then
Break;
End;
爪哇
while (true)
{
String s = buffer.readLine();
if (s.equals("exit"))
break;
}
“這種與 Pascal 的比較可能對了解 Pascal 的人有用。”
“你是說你不知道?拜託!這是我家鄉星球上最流行的語言。”
“好吧,好吧。我相信你,這很酷。而且如果我知道它,它會對我有幫助。”