Language: Java

#include <stdio.h>

int main(){
  int n,q,C;
  int i,j;
  int count=0,scount=0;

  scanf("%d",&n);
  int S[n+1];
  for(i=0; i<n; i++){
    scanf("%d",&S[i]);
  }

  //重複を数える
  for(i=n-1; i>0; i--){
    for(j=i-1; j>=0; j--){
      if(S[i]==S[j]){
        scount++;
      }
    }
  }

  scanf("%d",&q);
  int T[q];
  for(i=0; i<q; i++){
    scanf("%d",&T[i]);
  }

 //数列Tの中で数列Sに含まれる個数
  for(i=0; i<n; i++){
    for(j=0; j<q; j++){
      if(S[i]==T[j]) {
        count++;
        break;
      }
    }
  }

//printf("重複数 %d\n",scount);
//printf("服む個数 %d\n",count);
  printf("%d\n",count-scount);

  return 0;

}



Compiler output:
Main.java:1: error: illegal character: '#'
#include <stdio.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <stdio.h>
         ^
Main.java:5: error: class, interface, enum, or record expected
  int i,j;
  ^
Main.java:6: error: unnamed classes are a preview feature and are disabled by default.
  int count=0,scount=0;
  ^
  (use --enable-preview to enable unnamed classes)
Main.java:8: error: class, interface, enum, or record expected
  scanf("%d",&n);
  ^
Main.java:9: error: class, interface, enum, or record expected
  int S[n+1];
  ^
Main.java:10: error: class, interface, enum, or record expected
  for(i=0; i<n; i++){
  ^
Main.java:10: error: class, interface, enum, or record expected
  for(i=0; i<n; i++){
           ^
Main.java:10: error: class, interface, enum, or record expected
  for(i=0; i<n; i++){
                ^
Main.java:12: error: class, interface, enum, or record expected
  }
  ^
Main.java:15: error: class, interface, enum, or record expected
  for(i=n-1; i>0; i--){
             ^
Main.java:15: error: class, interface, enum, or record expected
  for(i=n-1; i>0; i--){
                  ^
Main.java:16: error: class, interface, enum, or record expected
    for(j=i-1; j>=0; j--){
               ^
Main.java:16: error: class, interface, enum, or record expected
    for(j=i-1; j>=0; j--){
                     ^
Main.java:19: error: class, interface, enum, or record expected
      }
      ^
Main.java:24: error: class, interface, enum, or record expected
  int T[q];
  ^
Main.java:25: error: class, interface, enum, or record expected
  for(i=0; i<q; i++){
  ^
Main.java:25: error: class, interface, enum, or record expected
  for(i=0; i<q; i++){
           ^
Main.java:25: error: class, interface, enum, or record expected
  for(i=0; i<q; i++){
                ^
Main.java:27: error: class, interface, enum, or record expected
  }
  ^
Main.java:30: error: class, interface, enum, or record expected
  for(i=0; i<n; i++){
           ^
Main.java:30: error: class, interface, enum, or record expected
  for(i=0; i<n; i++){
                ^
Main.java:31: error: class, interface, enum, or record expected
    for(j=0; j<q; j++){
             ^
Main.java:31: error: class, interface, enum, or record expected
    for(j=0; j<q; j++){
                  ^
Main.java:34: error: class, interface, enum, or record expected
        break;
        ^
Main.java:35: error: class, interface, enum, or record expected
      }
      ^
Main.java:43: error: class, interface, enum, or record expected
  return 0;
  ^
Main.java:45: error: class, interface, enum, or record expected
}
^
28 errors