#define __USE_XOPEN #define _GNU_SOURCE #include #include #include int main() { char buffer[20]; struct tm tm = {0}; char *retval = fgets(buffer, sizeof(buffer), stdin); if (retval == 0) { puts("Neplatny datum"); return 0; } retval = strptime(buffer, "%e.%m.%-Y", &tm); if (retval == 0) { puts("Neplatny datum"); return 0; } tm.tm_isdst = -1; tm.tm_mday += 7; mktime(&tm); strftime(buffer, sizeof(buffer), "%e.%m.%-Y", &tm); puts(buffer); putc('\n', stdout); return 0; }