https://i1.wp.com/eblogarithm.com/wp-content/uploads/2017/01/Codeforces-Round-393-Div-2-8VC-Venture-Cup-2017--Final-Round-Div-2-Edition-problem-A-Petr-and-a-calendar-Solution-in-CC1.png?fit=640%2C360

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 82 times, 1 visits today)



There are no comments

Add yours

Leave a Reply

%d bloggers like this: