Language: Java

#include <stdio.h>
#define uint unsigned int
int in() {
    int x = 0, c;
    for (; (uint)((c = getchar()) - '0') >= 10; ) { if (c == '-') return -in(); if (!~c) throw ~0; }
    do { x = (x << 3) + (x << 1) + (c - '0'); } while ((uint)((c = getchar()) - '0') < 10);
    return x;
}

int main(){
	int n,S;
	while(n=in(),S=in(),(n||S)){
		int w[102]={},a[102]={};
		int ans = 0;
		for(int i = 0 ; i < n ; i++){int b; w[b=in()]++; a[b]++; }
		for(int i = 99 ; i >= 0 ; i--) w[i] += w[i+1];
		for(int i = 0 ; i <= 100 ; i++) if(2*i>S) ans+=a[i]*(a[i]-1)/2;
		for(int i = 1 ; i <= 100 ; i++) ans+=a[i]*w[i>S-i?i+1:S-i+1];
		printf("%d%c",ans,10);
	}
}

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:2: error: illegal character: '#'
#define uint unsigned int
^
Main.java:5: error: class, interface, enum, or record expected
    for (; (uint)((c = getchar()) - '0') >= 10; ) { if (c == '-') return -in(); if (!~c) throw ~0; }
    ^
Main.java:5: error: class, interface, enum, or record expected
    for (; (uint)((c = getchar()) - '0') >= 10; ) { if (c == '-') return -in(); if (!~c) throw ~0; }
           ^
Main.java:5: error: class, interface, enum, or record expected
    for (; (uint)((c = getchar()) - '0') >= 10; ) { if (c == '-') return -in(); if (!~c) throw ~0; }
                                                ^
Main.java:5: error: class, interface, enum, or record expected
    for (; (uint)((c = getchar()) - '0') >= 10; ) { if (c == '-') return -in(); if (!~c) throw ~0; }
                                                                                ^
Main.java:5: error: class, interface, enum, or record expected
    for (; (uint)((c = getchar()) - '0') >= 10; ) { if (c == '-') return -in(); if (!~c) throw ~0; }
                                                                                                   ^
Main.java:6: error: class, interface, enum, or record expected
    do { x = (x << 3) + (x << 1) + (c - '0'); } while ((uint)((c = getchar()) - '0') < 10);
                                              ^
Main.java:7: error: class, interface, enum, or record expected
    return x;
    ^
Main.java:8: error: class, interface, enum, or record expected
}
^
Main.java:12: error: class, interface, enum, or record expected
	while(n=in(),S=in(),(n||S)){
	^
Main.java:14: error: unnamed classes are a preview feature and are disabled by default.
		int ans = 0;
		^
  (use --enable-preview to enable unnamed classes)
Main.java:15: error: class, interface, enum, or record expected
		for(int i = 0 ; i < n ; i++){int b; w[b=in()]++; a[b]++; }
		^
Main.java:15: error: class, interface, enum, or record expected
		for(int i = 0 ; i < n ; i++){int b; w[b=in()]++; a[b]++; }
		                ^
Main.java:15: error: class, interface, enum, or record expected
		for(int i = 0 ; i < n ; i++){int b; w[b=in()]++; a[b]++; }
		                        ^
Main.java:15: error: ']' expected
		for(int i = 0 ; i < n ; i++){int b; w[b=in()]++; a[b]++; }
		                                      ^
Main.java:15: error: ';' expected
		for(int i = 0 ; i < n ; i++){int b; w[b=in()]++; a[b]++; }
		                                            ^
Main.java:15: error: class, interface, enum, or record expected
		for(int i = 0 ; i < n ; i++){int b; w[b=in()]++; a[b]++; }
		                                                 ^
Main.java:15: error: class, interface, enum, or record expected
		for(int i = 0 ; i < n ; i++){int b; w[b=in()]++; a[b]++; }
		                                                         ^
Main.java:16: error: class, interface, enum, or record expected
		for(int i = 99 ; i >= 0 ; i--) w[i] += w[i+1];
		                 ^
Main.java:16: error: class, interface, enum, or record expected
		for(int i = 99 ; i >= 0 ; i--) w[i] += w[i+1];
		                          ^
Main.java:17: error: class, interface, enum, or record expected
		for(int i = 0 ; i <= 100 ; i++) if(2*i>S) ans+=a[i]*(a[i]-1)/2;
		^
Main.java:17: error: class, interface, enum, or record expected
		for(int i = 0 ; i <= 100 ; i++) if(2*i>S) ans+=a[i]*(a[i]-1)/2;
		                ^
Main.java:17: error: class, interface, enum, or record expected
		for(int i = 0 ; i <= 100 ; i++) if(2*i>S) ans+=a[i]*(a[i]-1)/2;
		                           ^
Main.java:18: error: class, interface, enum, or record expected
		for(int i = 1 ; i <= 100 ; i++) ans+=a[i]*w[i>S-i?i+1:S-i+1];
		^
Main.java:18: error: class, interface, enum, or record expected
		for(int i = 1 ; i <= 100 ; i++) ans+=a[i]*w[i>S-i?i+1:S-i+1];
		                ^
Main.java:18: error: class, interface, enum, or record expected
		for(int i = 1 ; i <= 100 ; i++) ans+=a[i]*w[i>S-i?i+1:S-i+1];
		                           ^
Main.java:19: error: class, interface, enum, or record expected
		printf("%d%c",ans,10);
		^
Main.java:20: error: class, interface, enum, or record expected
	}
	^
30 errors