Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Author: 曹北健
- Result: AC Submission_id: 4264867
- Created at: Wed Mar 30 2022 23:09:57 GMT+0800 (China Standard Time)
- Problem_id: 5443 Time: 4 Memory: 1748
- */
- #include <stdio.h>
- #include <time.h>
- #include <string.h>
- typedef long long LL;
- typedef unsigned long long ULL;
- int main(){
- time_t tim0 = 0;
- struct tm *pt, tmp = { 0 }, tmp2;
- int n, y, d;
- scanf("%d", &n);
- while(n--){
- memset(&tmp, 0, sizeof(tmp));
- scanf("%d%d", &y, &d);
- tmp.tm_year = y - 1900;
- tim0 = mktime(&tmp);
- tim0 += (d * (60 * 60 * 24));
- pt = localtime(&tim0);
- if(pt){
- memcpy(&tmp2, pt, sizeof(tmp2));
- printf("%d %d\n", tmp2.tm_mon + 1, tmp2.tm_mday);
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment