Submission

Status:

PPPPPPPP--P--PP-PPPP

Subtask/Task Score:

75/100

Score: 75

User: qwert

Problemset: ปฏิทินวันแม่

Language: cpp

Time: 0.003 second

Submitted On: 2025-10-07 18:31:21

#include <iostream>
using namespace std;

int main()
{
	int m,d,arr1[12]={31,28,31,30,31,30,31,11},arr2[6]={31,30,31,30,31,12},s=0,f;
	
	cin>>m>>d;
	
	if(m<8){
		for(int i=m-1; i<=7; i++){
		s = s + arr1[i];
		}
				
		f=s%7;
		d=(d+f)%7;
		cout<<d;
	}
	else{
		for(int i=m; i>=5; i--){
			s = s + arr2[i];
		}
		f=s%7;
		d=(d+f)%7;
		cout<<d;
	}

	
	
}