CodeGym /Kurse /All lectures for DE purposes /Bedingungen vom Planeten Pascal

Bedingungen vom Planeten Pascal

All lectures for DE purposes
Level 1, Lektion 572
Verfügbar

„Hallo, Amigo. Auf unserem Planeten verwenden wir Pascal, das fortschrittlicher ist. Das würde in Pascal so aussehen.“

Pascal
If a < b Then
    WriteLn ('a is less than b');
Java
if (a < b)
    System.out.println("a is less than b");
Pascal
If a < b Then
    WriteLn('a is less than b')
Else
    WriteLn('a is greater than b');
Java
if (a < b)
    System.out.println("a is less than b");
else
    System.out.println("a is greater than b");
Pascal
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;
Java
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");
}

Pascal
If a < b And a < c Then
    WriteLn('a is the minimum of a, b, c');
Java
if (a < b && a < c)
    System.out.println("a is the minimum of a, b, c");
Pascal
If a < b Or a < c Then
    WriteLn('a is either less than b, or less than c');
Java
if (a < b || a < c)
    System.out.println("a is either less than b, or less than c");
Pascal
If Not (a < b) Then
    WriteLn('b is less than or equal to a')
Else
    WriteLn('b is greater than a');
Java
if ( !(a < b) )
    System.out.println("b is less than or equal to a");
else
    System.out.println("b is greater than a");
Pascal
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;
Java
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");
}
Pascal
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');
Java
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");
Kommentare (3)
TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
GO TO FULL VERSION
DigitalNomad Level 7, Germany
8 Januar 2025
Eine Erklärung für diese Lektion (warum sie nützlich ist) wäre hilfreich.
Hariboto Level 7, Dresden, Germany
9 Februar 2023
Warum wird behauptet, dass Pascal fortschrittlicher ist?
Florian Winkler Level 9, Austria Expert
15 Juli 2023
Das Alien weiß es halt nicht besser🙃