Codeforces Round #393 (Div. 2) (8VC Venture Cup 2017 – Final Round Div. 2 Edition), problem: (A) Petr and a calendar Solution in C/C++

#include<stdio.h>
int main()
{
int a[12]={31,28,31,30,31,30,31,31,30,31,30,31};
int i,m,d,k,n,p;
scanf(“%d %d”,&m,&d);
k=7-d+1;
i=m-1;
n=a[i]-k;
p=n/7;
if(p*7!=n)
p++;
printf(“%d”,p+1);

}

(Visited 116 times, 1 visits today)

About the Author:

Leave A Comment