Submission

Status:
PPPPPPPPP----PP-PPPP

Score: 75

User: www._.

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

Language: cpp

Time: 0.003 second

Submitted On: 2024-12-15 10:34:59

#include <iostream>
using namespace std;

int main() 
{
  int numdays[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

  int m,d;
  cin >> m >> d;

  int tmonth = 8;
  int tday = 12;
  int currentday = d-1;

  for(int i=m-1;i <tmonth - 1;i++)
    {
      currentday += numdays[i];
    }
  
  currentday += tday-1;
  int motherday = (currentday % 7)+1;
  cout << motherday << endl;
  //cout << currentday << endl;
}