pvjc20/du3/program.c

30 lines
508 B
C
Raw Normal View History

2020-03-26 20:05:21 +00:00
#define _XOPEN_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
int main()
{
char dateStr[11];
struct tm t;
fgets(dateStr, 11, stdin);
strptime(dateStr, "%d.%m.%Y", &t);
t.tm_mday += 7;
2020-03-26 20:17:05 +00:00
if(t.tm_mon + 1 < 10){
printf(" %d.0%d.%d", t.tm_mday, t.tm_mon + 1, t.tm_year + 1900);
2020-03-26 20:18:00 +00:00
} else{
printf(" %d.%d.%d", t.tm_mday, t.tm_mon + 1, t.tm_year + 1900);
2020-03-26 20:17:05 +00:00
}
2020-03-26 20:05:21 +00:00
exit(EXIT_SUCCESS);
return 0;
}