Language: Java

#include <vector>
#include <list>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <utility>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <cassert>
using namespace std;
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n) FOR(i,0,(n)-1)
const double EPS = 1e-10;
const double PI  = acos(-1.0);
const int INF = INT_MAX/10;

string days[] = {"Thursday", "Friday", "Saturday", "Sunday", "Monday", "Tuesday", "Wednesday"};
int day[] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

int main() {
	int m, d;
	while(cin >> m >> d, m) {
		int res = 0;
		for(int i = 1; i < m; i++) {
			res += day[i-1];
		}
		res += (d-1);

		cout << days[res%7] << endl;
	}

	return 0;
}

Compiler output:
Main.java:1: error: illegal character: '#'
#include <vector>
^
Main.java:2: error: illegal character: '#'
#include <list>
^
Main.java:3: error: illegal character: '#'
#include <map>
^
Main.java:4: error: illegal character: '#'
#include <set>
^
Main.java:5: error: illegal character: '#'
#include <stack>
^
Main.java:6: error: illegal character: '#'
#include <queue>
^
Main.java:7: error: illegal character: '#'
#include <deque>
^
Main.java:8: error: illegal character: '#'
#include <algorithm>
^
Main.java:9: error: illegal character: '#'
#include <utility>
^
Main.java:10: error: illegal character: '#'
#include <functional>
^
Main.java:11: error: illegal character: '#'
#include <sstream>
^
Main.java:12: error: illegal character: '#'
#include <iostream>
^
Main.java:13: error: illegal character: '#'
#include <cstdio>
^
Main.java:14: error: illegal character: '#'
#include <cmath>
^
Main.java:15: error: illegal character: '#'
#include <cstdlib>
^
Main.java:16: error: illegal character: '#'
#include <cctype>
^
Main.java:17: error: illegal character: '#'
#include <string>
^
Main.java:18: error: illegal character: '#'
#include <cstring>
^
Main.java:19: error: illegal character: '#'
#include <ctime>
^
Main.java:20: error: illegal character: '#'
#include <climits>
^
Main.java:21: error: illegal character: '#'
#include <cassert>
^
Main.java:23: error: class, interface, enum, or record expected
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
^
Main.java:23: error: unnamed classes are a preview feature and are disabled by default.
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
                                   ^
  (use --enable-preview to enable unnamed classes)
Main.java:23: error: <identifier> expected
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
                                                      ^
Main.java:23: error: class, interface, enum, or record expected
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
                                                        ^
Main.java:23: error: class, interface, enum, or record expected
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
                                                               ^
Main.java:23: error: class, interface, enum, or record expected
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
                                                                        ^
Main.java:24: error: '{' expected
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
                ^
Main.java:24: error: <identifier> expected
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
                                                                      ^
Main.java:24: error: <identifier> expected
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
                                                                         ^
Main.java:24: error: illegal start of type
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
                                                                          ^
Main.java:24: error: <identifier> expected
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
                                                                                         ^
Main.java:25: error: class, interface, enum, or record expected
typedef vector<int> vi;
^
Main.java:26: error: class, interface, enum, or record expected
typedef vector<vi> vvi;
^
Main.java:27: error: class, interface, enum, or record expected
typedef vector<string> vs;
^
Main.java:28: error: class, interface, enum, or record expected
typedef pair<int, int> pii;
^
Main.java:29: error: class, interface, enum, or record expected
typedef long long ll;
^
Main.java:30: error: illegal character: '#'
#define ALL(a) (a).begin(),(a).end()
^
Main.java:30: error: class, interface, enum, or record expected
#define ALL(a) (a).begin(),(a).end()
        ^
Main.java:31: error: illegal character: '#'
#define RALL(a) (a).rbegin(),(a).rend()
^
Main.java:32: error: illegal character: '#'
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
^
Main.java:32: error: class, interface, enum, or record expected
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
                                 ^
Main.java:32: error: class, interface, enum, or record expected
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
                                        ^
Main.java:33: error: illegal character: '#'
#define REP(i,n) FOR(i,0,(n)-1)
^
Main.java:35: error: class, interface, enum, or record expected
const double PI  = acos(-1.0);
^
Main.java:36: error: class, interface, enum, or record expected
const int INF = INT_MAX/10;
^
Main.java:38: error: class, interface, enum, or record expected
string days[] = {"Thursday", "Friday", "Saturday", "Sunday", "Monday", "Tuesday", "Wednesday"};
^
Main.java:39: error: class, interface, enum, or record expected
int day[] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
^
Main.java:43: error: not a statement
	while(cin >> m >> d, m) {
	                     ^
Main.java:50: error: not a statement
		cout << days[res%7] << endl;
		                    ^
Main.java:43: error: ')' expected
	while(cin >> m >> d, m) {
	                   ^
Main.java:43: error: ';' expected
	while(cin >> m >> d, m) {
	                      ^
52 errors