Language: C++

import java.util.*;
class Main {
    public static void main(String[] args){
      Scanner str = new Scanner(System.in);
 
String[] strArray = str.split("");
boolean code = false;
for(int i=0;i++;i<strArray.length-1){
  int num1 = Integer.parseInt(strArray[i]);
  int num2 = Integer.parseInt(strArray[i+1]);
  if(num1==num2){
    code = true;
  }
}
 
if(code){
  System.out.println("Good");
}
else{
  System.out.println("Bad");
}
Scanner str = new Scanner(System.in);
 
String[] strArray = str.split("");
boolean code = false;
for(int i=0;i++;i<strArray.length-1){
  int num1 = Integer.parseInt(strArray[i]);
  int num2 = Integer.parseInt(strArray[i+1]);
  if(num1==num2){
    code = true;
  }
}
 
if(code){
  System.out.println("Good");
}
else{
  System.out.println("Bad");
}
    }}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:11: error: expected ':' before 'static'
    3 |     public static void main(String[] args){
      |           ^~~~~~~
      |           :
a.cc:3:29: error: 'String' has not been declared
    3 |     public static void main(String[] args){
      |                             ^~~~~~
a.cc:3:38: error: expected ',' or '...' before 'args'
    3 |     public static void main(String[] args){
      |                                      ^~~~
a.cc:40:7: error: expected ';' after class definition
   40 |     }}
      |       ^
      |       ;
a.cc: In static member function 'static void Main::main(int*)':
a.cc:4:7: error: 'Scanner' was not declared in this scope
    4 |       Scanner str = new Scanner(System.in);
      |       ^~~~~~~
a.cc:6:1: error: 'String' was not declared in this scope
    6 | String[] strArray = str.split("");
      | ^~~~~~
a.cc:6:8: error: expected primary-expression before ']' token
    6 | String[] strArray = str.split("");
      |        ^
a.cc:7:1: error: 'boolean' was not declared in this scope; did you mean 'bool'?
    7 | boolean code = false;
      | ^~~~~~~
      | bool
a.cc:8:19: error: 'strArray' was not declared in this scope
    8 | for(int i=0;i++;i<strArray.length-1){
      |                   ^~~~~~~~
a.cc:9:14: error: 'Integer' was not declared in this scope
    9 |   int num1 = Integer.parseInt(strArray[i]);
      |              ^~~~~~~
a.cc:12:5: error: 'code' was not declared in this scope
   12 |     code = true;
      |     ^~~~
a.cc:16:4: error: 'code' was not declared in this scope
   16 | if(code){
      |    ^~~~
a.cc:17:3: error: 'System' was not declared in this scope
   17 |   System.out.println("Good");
      |   ^~~~~~
a.cc:20:3: error: 'System' was not declared in this scope
   20 |   System.out.println("Bad");
      |   ^~~~~~
a.cc:22:9: error: expected ';' before 'str'
   22 | Scanner str = new Scanner(System.in);
      |         ^~~
a.cc:24:8: error: expected primary-expression before ']' token
   24 | String[] strArray = str.split("");
      |        ^
a.cc:25:9: error: expected ';' before 'code'
   25 | boolean code = false;
      |         ^~~~
a.cc:26:19: error: 'strArray' was not declared in this scope
   26 | for(int i=0;i++;i<strArray.length-1){
      |                   ^~~~~~~~
a.cc:27:14: error: 'Integer' was not declared in this scope
   27 |   int num1 = Integer.parseInt(strArray[i]);
      |              ^~~~~~~
a.cc:30:5: error: 'code' was not declared in this scope
   30 |     code = true;
      |     ^~~~
a.cc:34:4: error: 'code' was not declared in this scope
   34 | if(code){
      |    ^~~~
a.cc:35:3: error: 'System' was not declared in this scope
   35 |   System.out.println("Good");
      |   ^~~~~~
a.cc:38:3: error: 'System' was not declared in this scope
   38 |   System.out.println("Bad");
      |   ^~~~~~