"안녕, 아미고. 우리 행성에서는 더 발전된 파스칼을 사용한다. 파스칼에서는 이렇게 보일 것이다."
파스칼
If a < b Then
WriteLn ('a is less than b');
자바
if (a < b)
System.out.println("a is less than b");
파스칼
If a < b Then
WriteLn('a is less than b')
Else
WriteLn('a is greater than b');
자바
if (a < b)
System.out.println("a is less than b");
else
System.out.println("a is greater than b");
파스칼
If a < b Then
Begin
WriteLn('a is less than b');
WriteLn('a is less than b');
End
Else
Begin
WriteLn('a is greater than b');
WriteLn('a is greater than b');
End;
자바
if (a < b)
{
System.out.println("a is less than b");
System.out.println("a is less than b");
}
else
{
System.out.println("a is greater than b");
System.out.println("a is greater than b");
}
파스칼
If a < b And a < c Then
WriteLn('a is the minimum of a, b, c');
자바
if (a < b && a < c)
System.out.println("a is the minimum of a, b, c");
파스칼
If a < b Or a < c Then
WriteLn('a is either less than b, or less than c');
자바
if (a < b || a < c)
System.out.println("a is either less than b, or less than c");
파스칼
If Not (a < b) Then
WriteLn('b is less than or equal to a')
Else
WriteLn('b is greater than a');
자바
if ( !(a < b) )
System.out.println("b is less than or equal to a");
else
System.out.println("b is greater than a");
파스칼
If a < b Then
Begin
If a < c Then
WriteLn('a is the minimum')
Else
WriteLn('c is the minimum');
End
Else
Begin
If b < c Then
WriteLn('b is the minimum')
Else
WriteLn('c is the minimum');
End;
자바
if (a < b)
{
if (a < c)
System.out.println("a is the minimum");
else
System.out.println("c is the minimum");
}
else
{
if (b < c)
System.out.println("b is the minimum");
else
System.out.println("c is the minimum");
}
파스칼
If a <= b And a <= c Then
WriteLn('a is the minimum')
Else If b <= a And b <= c Then
WriteLn('b is the minimum')
Else If c <= a And c <= b Then
WriteLn('c is the minimum');
자바
if (a <= b && a <= c)
System.out.println("a is the minimum");
else if (b <= a && b <= c)
System.out.println("b is the minimum");
else if (c <= a && c <= b)
System.out.println("c is the minimum");
GO TO FULL VERSION