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

By |2017-04-07T22:10:18+06:00January 23rd, 2017|Categories: C/C++, Programming|Tags: , , , , , , , , , |

#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); }