#include main(){ int count = 0; int maxd[] = {31,28,31,30,31,30,31,31,30,31,30,31}; //1~9month //0nday,1(n-1)day,2(n-2)day,3(n-3)dayが存在する for(int i = 0;i < 10;i++){ for(int j = 0;j < 4;j++){ if(i-j >= 0 && j*10 + (i-j) <= maxd[i]){ count++; } } } //10~12month for(int i = 10;i < 13;i++){ for(int j = 1;j < 4;j++){ if(i-j < 10 && j*10 + (i-j) <= maxd[i]){ count++; } } } printf("%d\n",count); }