Language: Java

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Deque;
import java.util.HashMap;
import java.util.InputMismatchException;
import java.util.Map;
import java.util.PriorityQueue;
import java.math.BigInteger;
import java.math.BigDecimal;
??????????????
public class Main{
??????
static final InputStream in=System.in;
static final PrintWriter out=new PrintWriter(System.out);
static final int INF=Integer.MAX_VALUE/2;
static final long LINF=Long.MAX_VALUE/2;
static int MAX=100000;
static char[] str=new char[MAX+1];
??????
public static void main(String[] args) throws IOException{
????BufferedReader br=new BufferedReader(new InputStreamReader(in));
????int n=Integer.parseInt(br.readLine());
????while(n-->0){
????????String line=br.readLine();
????????int cur=0;
????????for(int i=0;i<=MAX;i++) str[i]='-';
????????for(int i=0;i<line.length();i++) str[i]=line.charAt(i);
????????int m=Integer.parseInt(br.readLine());
????????while(m-->0){
????????????String[] com=br.readLine().split(" ");
????????????String com0=com[0];
????????????String com1=com[1];
????????????if("forward".equals(com0)){
????????????????if("char".equals(com1)&&str[cur]!='-') cur++;
????????????????else{
????????????????????while(str[cur]==' ') cur++;
????????????????????while(str[cur]!=' '&&str[cur]!='-') cur++;
????????????????}
????????????}
????????????else if("backward".equals(com0)){
????????????????if("char".equals(com1)&&cur!=0) cur--;
????????????????else{
????????????????????while(cur>0&&str[cur-1]==' ') cur--;
????????????????????while(cur>0&&str[cur-1]!=' ') cur--;
????????????????}
????????????}
????????????else if("insert".equals(com0)){
????????????????if(com1.length()>2){
????????????????????String insertionStr=com[1].substring(1,com1.length()-1);
????????????????????for(int i=MAX-insertionStr.length();i>=cur;i--){
????????????????????????if(str[i]!='-') str[i+insertionStr.length()]=str[i];
????????????????????}
????????????????????for(int i=0;i<insertionStr.length();i++){
????????????????????????str[cur+i]=insertionStr.charAt(i);
????????????????????}
????????????????????cur+=insertionStr.length();
????????????????}
????????????}
????????????else{
????????????????if("char".equals(com1)&&str[cur]!='-'){
????????????????????for(int i=cur;i<=MAX;i++){
????????????????????????if(str[i]=='-') break;
????????????????????????str[i]=str[i+1];
????????????????????}
????????????????}
????????????????else{
????????????????????int cnt=cur;
????????????????????boolean flag=false;
????????????????????while(str[cnt]==' ') cnt++;
????????????????????while(str[cnt]!=' '&&str[cnt]!='-'){
????????????????????????cnt++;
????????????????????????flag=true;
????????????????????}
????????????????????if(flag){
????????????????????????for(int i=cnt;i<=MAX;i++){
????????????????????????if(str[i-cnt+cur]=='-') break;
????????????????????????????str[i-cnt+cur]=str[i];
????????????????????????}
????????????????????}
????????????????}
????????????}
????????}
????????for(int i=0;;i++){
????????????if(i==cur) out.print("^");
????????????if(str[i]=='-') break;
????????????out.print(str[i]);
????????}
????????out.println();
????}
out.flush();
}
}

Compiler output:
Main.java:17: error: class, interface, enum, or record expected
??????????????
^
Main.java:19: error: illegal start of type
??????
^
Main.java:26: error: illegal start of type
??????
^
Main.java:28: error: illegal start of expression
????BufferedReader br=new BufferedReader(new InputStreamReader(in));
^
Main.java:28: error: illegal start of expression
????BufferedReader br=new BufferedReader(new InputStreamReader(in));
 ^
Main.java:28: error: illegal start of expression
????BufferedReader br=new BufferedReader(new InputStreamReader(in));
  ^
Main.java:28: error: illegal start of expression
????BufferedReader br=new BufferedReader(new InputStreamReader(in));
   ^
Main.java:28: error: : expected
????BufferedReader br=new BufferedReader(new InputStreamReader(in));
                  ^
Main.java:28: error: : expected
????BufferedReader br=new BufferedReader(new InputStreamReader(in));
                                                                   ^
Main.java:29: error: illegal start of expression
????int n=Integer.parseInt(br.readLine());
^
Main.java:29: error: illegal start of expression
????int n=Integer.parseInt(br.readLine());
 ^
Main.java:29: error: illegal start of expression
????int n=Integer.parseInt(br.readLine());
  ^
Main.java:29: error: illegal start of expression
????int n=Integer.parseInt(br.readLine());
   ^
Main.java:29: error: '.class' expected
????int n=Integer.parseInt(br.readLine());
        ^
Main.java:29: error: : expected
????int n=Integer.parseInt(br.readLine());
                                         ^
Main.java:30: error: illegal start of expression
????while(n-->0){
^
Main.java:30: error: illegal start of expression
????while(n-->0){
 ^
Main.java:30: error: illegal start of expression
????while(n-->0){
  ^
Main.java:30: error: illegal start of expression
????while(n-->0){
   ^
Main.java:30: error: illegal start of expression
????while(n-->0){
    ^
Main.java:31: error: illegal start of expression
????????String line=br.readLine();
^
Main.java:31: error: illegal start of expression
????????String line=br.readLine();
 ^
Main.java:31: error: illegal start of expression
????????String line=br.readLine();
  ^
Main.java:31: error: illegal start of expression
????????String line=br.readLine();
   ^
Main.java:31: error: illegal start of expression
????????String line=br.readLine();
    ^
Main.java:31: error: illegal start of expression
????????String line=br.readLine();
     ^
Main.java:31: error: illegal start of expression
????????String line=br.readLine();
      ^
Main.java:31: error: illegal start of expression
????????String line=br.readLine();
       ^
Main.java:31: error: : expected
????????String line=br.readLine();
              ^
Main.java:31: error: : expected
????????String line=br.readLine();
                                 ^
Main.java:32: error: illegal start of expression
????????int cur=0;
^
Main.java:32: error: illegal start of expression
????????int cur=0;
 ^
Main.java:32: error: illegal start of expression
????????int cur=0;
  ^
Main.java:32: error: illegal start of expression
????????int cur=0;
   ^
Main.java:32: error: illegal start of expression
????????int cur=0;
    ^
Main.java:32: error: illegal start of expression
????????int cur=0;
     ^
Main.java:32: error: illegal start of expression
????????int cur=0;
      ^
Main.java:32: error: illegal start of expression
????????int cur=0;
       ^
Main.java:32: error: '.class' expected
????????int cur=0;
            ^
Main.java:32: error: : expected
????????int cur=0;
                 ^
Main.java:33: error: illegal start of expression
????????for(int i=0;i<=MAX;i++) str[i]='-';
^
Main.java:33: error: illegal start of expression
????????for(int i=0;i<=MAX;i++) str[i]='-';
 ^
Main.java:33: error: illegal start of expression
????????for(int i=0;i<=MAX;i++) str[i]='-';
  ^
Main.java:33: error: illegal start of expression
????????for(int i=0;i<=MAX;i++) str[i]='-';
   ^
Main.java:33: error: illegal start of expression
????????for(int i=0;i<=MAX;i++) str[i]='-';
    ^
Main.java:33: error: illegal start of expression
????????for(int i=0;i<=MAX;i++) str[i]='-';
     ^
Main.java:33: error: illegal start of expression
????????for(int i=0;i<=MAX;i++) str[i]='-';
      ^
Main.java:33: error: illegal start of expression
????????for(int i=0;i<=MAX;i++) str[i]='-';
       ^
Main.java:33: error: illegal start of expression
????????for(int i=0;i<=MAX;i++) str[i]='-';
        ^
Main.java:34: error: illegal start of expression
????????for(int i=0;i<line.length();i++) str[i]=line.charAt(i);
^
Main.java:34: error: illegal start of expression
????????for(int i=0;i<line.length();i++) str[i]=line.charAt(i);
 ^
Main.java:34: error: illegal start of expression
????????for(int i=0;i<line.length();i++) str[i]=line.charAt(i);
  ^
Main.java:34: error: illegal start of expression
????????for(int i=0;i<line.length();i++) str[i]=line.charAt(i);
   ^
Main.java:34: error: illegal start of expression
????????for(int i=0;i<line.length();i++) str[i]=line.charAt(i);
    ^
Main.java:34: error: illegal start of expression
????????for(int i=0;i<line.length();i++) str[i]=line.charAt(i);
     ^
Main.java:34: error: illegal start of expression
????????for(int i=0;i<line.length();i++) str[i]=line.charAt(i);
      ^
Main.java:34: error: illegal start of expression
????????for(int i=0;i<line.length();i++) str[i]=line.charAt(i);
       ^
Main.java:34: error: illegal start of expression
????????for(int i=0;i<line.length();i++) str[i]=line.charAt(i);
        ^
Main.java:35: error: illegal start of expression
????????int m=Integer.parseInt(br.readLine());
^
Main.java:35: error: illegal start of expression
????????int m=Integer.parseInt(br.readLine());
 ^
Main.java:35: error: illegal start of expression
????????int m=Integer.parseInt(br.readLine());
  ^
Main.java:35: error: illegal start of expression
????????int m=Integer.parseInt(br.readLine());
   ^
Main.java:35: error: illegal start of expression
????????int m=Integer.parseInt(br.readLine());
    ^
Main.java:35: error: illegal start of expression
????????int m=Integer.parseInt(br.readLine());
     ^
Main.java:35: error: illegal start of expression
????????int m=Integer.parseInt(br.readLine());
      ^
Main.java:35: error: illegal start of expression
????????int m=Integer.parseInt(br.readLine());
       ^
Main.java:35: error: '.class' expected
????????int m=Integer.parseInt(br.readLine());
            ^
Main.java:35: error: : expected
????????int m=Integer.parseInt(br.readLine());
                                             ^
Main.java:36: error: illegal start of expression
????????while(m-->0){
^
Main.java:36: error: illegal start of expression
????????while(m-->0){
 ^
Main.java:36: error: illegal start of expression
????????while(m-->0){
  ^
Main.java:36: error: illegal start of expression
????????while(m-->0){
   ^
Main.java:36: error: illegal start of expression
????????while(m-->0){
    ^
Main.java:36: error: illegal start of expression
????????while(m-->0){
     ^
Main.java:36: error: illegal start of expression
????????while(m-->0){
      ^
Main.java:36: error: illegal start of expression
????????while(m-->0){
       ^
Main.java:36: error: illegal start of expression
????????while(m-->0){
        ^
Main.java:37: error: illegal start of expression
????????????String[] com=br.readLine().split(" ");
^
Main.java:37: error: illegal start of expression
????????????String[] com=br.readLine().split(" ");
 ^
Main.java:37: error: illegal start of expression
????????????String[] com=br.readLine().split(" ");
  ^
Main.java:37: error: illegal start of expression
????????????String[] com=br.readLine().split(" ");
   ^
Main.java:37: error: illegal start of expression
????????????String[] com=br.readLine().split(" ");
    ^
Main.java:37: error: illegal start of expression
????????????String[] com=br.readLine().split(" ");
     ^
Main.java:37: error: illegal start of expression
????????????String[] com=br.readLine().split(" ");
      ^
Main.java:37: error: illegal start of expression
????????????String[] com=br.readLine().split(" ");
       ^
Main.java:37: error: illegal start of expression
????????????String[] com=br.readLine().split(" ");
        ^
Main.java:37: error: illegal start of expression
????????????String[] com=br.readLine().split(" ");
         ^
Main.java:37: error: illegal start of expression
????????????String[] com=br.readLine().split(" ");
          ^
Main.java:37: error: illegal start of expression
????????????String[] com=br.readLine().split(" ");
           ^
Main.java:37: error: '.class' expected
????????????String[] com=br.readLine().split(" ");
                     ^
Main.java:37: error: : expected
????????????String[] com=br.readLine().split(" ");
                                                 ^
Main.java:38: error: illegal start of expression
????????????String com0=com[0];
^
Main.java:38: error: illegal start of expression
????????????String com0=com[0];
 ^
Main.java:38: error: illegal start of expression
????????????String com0=com[0];
  ^
Main.java:38: error: illegal start of expression
????????????String com0=com[0];
   ^
Main.java:38: error: illegal start of expression
????????????String com0=com[0];
    ^
Main.java:38: error: illegal start of expression
????????????String com0=com[0];
     ^
Main.java:38: error: illegal start of expression
????????????String com0=com[0];
      ^
Main.java:38: error: illegal start of expression
????????????String com0=com[0];
       ^
Main.java:38: error: illegal start of expression
????????????String com0=com[0];
        ^
100 errors
only showing the first 100 errors, of 1007 total; use -Xmaxerrs if you would like to see more
printing javac parameters to: /w/javac.20260128_024943.args