标签:
水。
#include<iostream> #include<cstdio> using namespace std; int a[][13] = {{0,31,28,31,30,31,30,31,31,30,31,30,31},{0,31,29,31,30,31,30,31,31,30,31,30,31}}; int main() { int y,d; cin >> y >> d; int choose = 0; if(!(y%4) && y%100 || !(y%400)) choose = 1; int m = 1; while(d > a[choose][m]) { d -= a[choose][m]; m++; } cout << m << endl << d << endl; return 0; }
标签:
原文地址:http://www.cnblogs.com/zhurb/p/5844277.html