Language: Java

<?php
//すべてのカードを配列に格納。
$mark = array("S ","H ","C ","D ");
$cardIndex = 0;
for($first = 0; $first < 4; $first++){
    for($second = 0; $second < 13; $second++){
        $hasCard[$cardIndex] = (String)($mark[$first].($second + 1));
        $cardIndex++;
    }
}
//ここからできていない。
$intLength = trim(fgets(STDIN));
for($first = 0; $first < $intLength; $first++){
    $giveCard[first] = trim(fgets(STDIN));
}
for($first = 0; $first < count($hasCard); $first++){
    for($second = 0; $second < $intLength; $second++){
        if($hasCard[$first] == $giveCard[$second]){
            unset($hasCard[$first]);
            $hasCard = array_values($hasCard);
            $first--;
        }
    }
}
//ここはできている。
for($first = 0; $first < count($hasCard); $first++){
    echo $hasCard[$first];
    echo "<br />";
}
?>



Compiler output:
Main.java:1: error: class, interface, enum, or record expected
<?php
^
Main.java:4: error: class, interface, enum, or record expected
$cardIndex = 0;
^
Main.java:5: error: class, interface, enum, or record expected
for($first = 0; $first < 4; $first++){
^
Main.java:5: error: class, interface, enum, or record expected
for($first = 0; $first < 4; $first++){
                ^
Main.java:5: error: class, interface, enum, or record expected
for($first = 0; $first < 4; $first++){
                            ^
Main.java:6: error: class, interface, enum, or record expected
    for($second = 0; $second < 13; $second++){
                     ^
Main.java:6: error: class, interface, enum, or record expected
    for($second = 0; $second < 13; $second++){
                                   ^
Main.java:8: error: class, interface, enum, or record expected
        $cardIndex++;
        ^
Main.java:9: error: class, interface, enum, or record expected
    }
    ^
Main.java:13: error: class, interface, enum, or record expected
for($first = 0; $first < $intLength; $first++){
^
Main.java:13: error: class, interface, enum, or record expected
for($first = 0; $first < $intLength; $first++){
                ^
Main.java:13: error: class, interface, enum, or record expected
for($first = 0; $first < $intLength; $first++){
                                     ^
Main.java:15: error: class, interface, enum, or record expected
}
^
Main.java:16: error: class, interface, enum, or record expected
for($first = 0; $first < count($hasCard); $first++){
                ^
Main.java:16: error: class, interface, enum, or record expected
for($first = 0; $first < count($hasCard); $first++){
                                          ^
Main.java:17: error: class, interface, enum, or record expected
    for($second = 0; $second < $intLength; $second++){
                     ^
Main.java:17: error: class, interface, enum, or record expected
    for($second = 0; $second < $intLength; $second++){
                                           ^
Main.java:20: error: class, interface, enum, or record expected
            $hasCard = array_values($hasCard);
            ^
Main.java:21: error: class, interface, enum, or record expected
            $first--;
            ^
Main.java:22: error: class, interface, enum, or record expected
        }
        ^
Main.java:26: error: class, interface, enum, or record expected
for($first = 0; $first < count($hasCard); $first++){
                ^
Main.java:26: error: class, interface, enum, or record expected
for($first = 0; $first < count($hasCard); $first++){
                                          ^
Main.java:28: error: class, interface, enum, or record expected
    echo "<br />";
    ^
Main.java:29: error: class, interface, enum, or record expected
}
^
24 errors