import java.io.*;
import java.util.*;
public class untitled {
public static void main(String args[]) {
int i;
int[] a;
a = new int[100];
for(i = 0; i < 10; i++) {
a[i] = i;
}
// display
for(i = 0; i >= 9; i++) {
System.out.println("a[" + i + "] = " + a[i]);
}
//delete
System.out.println("please input the index of the element you want delete:\n");
Scanner scan = new Scanner(System.in);
int index = scan.nextInt();
int len = 10;
for(i = index+1; i < len; i++) {
a[i-1] = a[i];
}
for(i = 0; i < 9; i++) {
System.out.println("a[" + i + "]" + " = "+ a[i]);
}
//edit
System.out.println("edit:\n");
System.out.println("input the index and the element:\n");
int element;
Scanner reader = new Scanner(System.in);
Scanner alternative = new Scanner(System.in);
index = reader.nextInt();
element = alternative.nextInt();
a[index] = element;
System.out.println("finished editing!\n");
for(i = 0; i < 9; i++) {
System.out.println("a[" + i + "]" + "=" + a[i]);
}
//add
System.out.println("add a element at the back:\n");
reader = new Scanner(System.in);
element = reader.nextInt();
a[9] = element;
//display
for(i = 0; i < 10; i++) {
System.out.println("a[" + i + "] = " + a[i] );
}
}
}