Go: package main

import (
	"bufio"
	"os"
	"strconv"
	"fmt"
)

var scanner = bufio.NewScanner(os.Stdin)

func nextInt() int {
	scanner.Scan()
	i, e := strconv.Atoi(scanner.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func zeller(month, day int) int {
	year := 2004
	if month == 1 || month == 2 {
		year--
		month += 12
	}
	return (year + year/4 - year/100 + year/400 + (13*month+8)/5 + day)%7
}

func main() {
	scanner.Split(bufio.ScanWords)
	for {
		month := nextInt()
		day := nextInt()
		if month == 0 && day == 0{
			break
		}
		switch zeller(month, day) {
		case 0:
			fmt.Println("Sunday")
		case 1:
			fmt.Println("Monday")
		case 2:
			fmt.Println("Tuesday")
		case 3:
			fmt.Println("Wednesday")
		case 4:
			fmt.Println("Thursday")
		case 5:
			fmt.Println("Friday")
		case 6:
			fmt.Println("Saturday")
		}
	}
}

C++: #include <bits/stdc++.h>
using namespace std;

int main(){
	int m,d,ans,i,tmp = 0;
	while(cin>>m>>d,m != 0){
		ans = 0;
		tmp = 0;
		for(i = m-1;i != 0;i--){
			switch(i){
				case 1:
				case 3:
				case 5:
				case 7:
				case 8:
				case 10:
			{
				tmp += 31;
				break;
			}
				case 4:
				case 6:
				case 9:
				case 11:
			{
				tmp += 30;
				break;
			}
				case 2:
			{
				tmp += 29;
				break;
			}
			}
		}
		tmp += d;
		ans = tmp % 7;
		switch(ans){
			case 0:{
				cout<<"Wednesday"<<endl;
				break;
			}
			case 1:{
				cout<<"Thursday"<<endl;
				break;
			}
			case 2:{
				cout<<"Friday"<<endl;
				break;
			}
			case 3:{
				cout<<"Saturday"<<endl;
				break;
			}
			case 4:{
				cout<<"Sunday"<<endl;
				break;
			}
			case 5:{
				cout<<"Monday"<<endl;
				break;
			}
			case 6:{
				cout<<"Tuesday"<<endl;
				break;
			}
		}
	}
	return 0;
}

C++: #include <iostream>
#include <string>
using namespace std;

int main()
{
	int m, d;
	int a[12] = { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
	string dt[7] = { "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" };

	cin >> m >> d;

	while (m > 0 || d > 0) {
		for (int i = 0; i < m - 1; i++)
			d += a[i];

		d += 2;
		d %= 7;	

		cout << dt[d] << endl;

		cin >> m >> d;
	}

	return 0;
}

C++: #include <iostream>
#include <string>
using namespace std;

int main(){
	string week[7] = {"Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"};
	int month[12] = {31,29,31,30,31,30,31,31,30,31,30,31};
	int m,d,cnt,mc;

	while( cin >> m >> d ){
		if(m==0) break;

		mc = 1;
		cnt = 3;
		while(1){
			for(int i=1 ; i <= month[mc-1] ; i++, cnt++){
				if(m==mc && d==i) break;
			}
			if(m==mc) break;
			mc++;
		}
		cout << week[cnt%7] << endl;
	}
	return 0;
}

C++: #include <iostream>
using namespace std;
int main()
{
	const int month[12]={31,29,31,30,31,30,31,31,30,31,30,31};
	while(1)
	{
		int a,b,count=0;
		cin >> a >> b;
		if(a==0&&b==0)break;
		for(int i=0;i<(a-1);i++)
		{
			count += month[i];
		}
		count += b;
		count %= 7;
		switch(count)
		{
			case 1:cout << "Thursday" << endl;break;
			case 2:cout << "Friday" << endl;break;
			case 3:cout << "Saturday" << endl;break;
			case 4:cout << "Sunday" << endl;break;
			case 5:cout << "Monday" << endl;break;
			case 6:cout << "Tuesday" << endl;break;
			case 0:cout << "Wednesday" << endl;break;
		}
	}
	return 0;
}

C++: #include <iostream>

using namespace std;

int main(void){

  int month;
  int day;
  int day2;

  while(1){

    day2 = 0;

    cin >> month >> day;
    if( month == 0 && day == 0 )break;

    for( int i = 1 ; i < month ; i++ ){
      switch(i){
      case 1:
      case 3:
      case 5:
      case 7:
      case 8:
      case 10:
      case 12:
	day2 += 31;
	break;
      case 2:
	day2 += 29;
	break;
      case 4:
      case 6:
      case 9:
      case 11:
	day2 += 30;
	break;
      }
    }
    day2 += day;
      switch(day2 % 7){
      case 1:
	cout << "Thursday" << endl;
	break;
      case 2:
	cout << "Friday" << endl;
	break;
      case 3:
	cout << "Saturday" << endl;
	break;
      case 4:
	cout << "Sunday" << endl;
	break;
      case 5:
	cout << "Monday" << endl;
	break;
      case 6:
	cout << "Tuesday" << endl;
	break;
      case 0:
	cout << "Wednesday" << endl;
    }
  }
  return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;
int main() {
    int m, d, w, days[] = {0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335};
    string wdays[] = {"Thursday", "Friday", "Saturday", "Sunday", "Monday", "Tuesday", "Wednesday"};
    while(cin >> m >> d) {
        if(m || d) {
            cout << wdays[(days[m - 1] + d - 1) % 7] << endl;
        }
    }
}

C++: #include <iostream>
#include <string>
#include <math.h>
#include <stdio.h>
#include <ctype.h>
 
using namespace std;
 
int main() {
    int M[13]={0,31,29,31,30,31,30,31,31,30,31,30,31};
    string W[7]={"Monday",
        "Tuesday",
        "Wednesday",
        "Thursday",
        "Friday",
        "Saturday",
        "Sunday"};
     
    int x,y;
    while(scanf("%d%d",&x,&y)!=EOF){
        if(x==0||y==0){
            break;
        }
        int day=0;
        for(int i=1; i<x; i++){
            day+=M[i];
        }
        day+=y+2;
        int week = day % 7;
        cout<<W[week]<<endl;
     
    }
    return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>

using namespace std;
string a[7] = {"Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"};
int main(void){
  int aa,b;
  int mon[12] = {31,28,
		 31,30,
		 31,30,
		 31,31,
		 30,31,
		 30,31};
  while(cin>>aa>>b,a+b){
    int d = b;
    for(int i = 0 ; i < aa-1 ; i ++){
      d += mon[i];
      cout<<d<<endl;
    }

    cout<<a[(d+2)%7]<<endl;
  }
  //*/
}

C++: #include <iostream>
#include <string>

using namespace std;

int main(){
	

	int dc[13];
	dc[1]=31;
	dc[2]=29;
	dc[3]=31;
	dc[4]=30;
	dc[5]=31;
	dc[6]=30;
	dc[7]=31;
	dc[8]=31;
	dc[9]=30;
	dc[10]=31;
	dc[11]=30;
	dc[12]=31;

	string week[8];
	week[0]="Monday";
	week[1]="Tuesday";
	week[2]="Wednesday";
	week[3]="Thursday";
	week[4]="Friday";
	week[5]="Saturday";
	week[6]="Sunday";

	int month;
	int day;
	while(cin>>month>>day&&!(month==0&&day==0)){
		int passingDay=2;
		for(int i = 1; i < month; i++){
			passingDay+=dc[i];
		}
		passingDay+=day;
		cout<<week[passingDay%7]<<endl;
	}

	return 0;
}

C++: //0027 What day is today?

//2004N11ú`1231úÜÅÌútðüÍµ½Æ«A»Ìjúð¦Ä­¾³¢
//È¨2004N11úÍØjúÅA2004NÍ[NÅ·

#include<iostream>
using namespace std;

int main(void)
{
	const char* week[] = 
	{
		"Monday",
		"Tuesday",
		"Wednesday",
		"Thursday",
		"Friday",
		"Saturday",
		"Sunday",
	};
	//indexÌú
	const int Days[] = 
	{
		0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
	};
	int month, day;
	
	while(cin >> month >> day, month)
	{
		cout << week[ (Days[month-1] + day) % 7 + 2] << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <string>
using namespace std;


int main() {
  const int n_day[] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  const string week_name[] = {
    "Wednesday",
    "Thursday",
    "Firday",
    "Saturday",
    "Sunday",
    "Monday",
    "Tuesday"
  };


  int m, d, sum=0;
  cin >> m >> d;
  while(m != 0 && d != 0) {
    m--;
    for(int i=0; i<m; i++) {
      sum += n_day[i];
    }
    sum += d;
    cout << week_name[sum%7] << endl;
    sum = 0;
    cin >> m >> d;
  }
  return 0;
}