#include #include #include int main(int argc, char *argv[]) { int lMax[13][2] = { { 3, 1 }, //1月 { 2, 8 }, //2月 { 3, 1 }, //3月 { 3, 0 }, //4月 { 3, 1 }, //5月 { 3, 0 }, //6月 { 3, 1 }, //7月 { 3, 1 }, //8月 { 3, 0 }, //9月 { 3, 1 }, //10月 { 3, 0 }, //11月 { 3, 1 }, //12月 }; int lCount = 0; for( int lMonth = 1; lMonth <= 12; lMonth++ ) { for( int lTenth = 0; lTenth <= lMax[lMonth][0]; lTenth++ ) { for( int lFirst = 1; lFirst < 10; lFirst++ ) { if( lMonth == lTenth + lFirst ) { //printf( "%d月%d%d日\n", lMonth, lTenth, lFirst ); lCount++; } if( lTenth == lMax[lMonth][0] && lFirst == lMax[lMonth][1] ) break; } } } printf( "%d\n", lCount ); return 0; }