cosdf
This commit is contained in:
parent
b65645ed8a
commit
5681a7d1cc
21
program.c
21
program.c
@ -1,13 +1,16 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
int main(){
|
int main()
|
||||||
//int day = 0;
|
{
|
||||||
//int mounth = 0;
|
/* initialize */
|
||||||
//int year = 0;
|
int y=0, m=0, d=0;
|
||||||
//scanf("%d.%d.%d", &day, &mounth, &year);
|
fgets("%d.%d.%d", &d, &m, &y);
|
||||||
time_t time;
|
struct tm t = { .tm_year=y-1900, .tm_mon=m-1, .tm_mday=d };
|
||||||
scanf("%e.%m.%Y", &time);
|
/* modify */
|
||||||
printf("%e.%m.%Y", time);
|
t.tm_mday += 40;
|
||||||
return 0;
|
mktime(&t);
|
||||||
|
/* show result */
|
||||||
|
printf("%s", asctime(&t)); /* prints: Sun Mar 16 00:00:00 1980 */
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user