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